Interface IContentManager
- Namespace
- Stride.Core.Serialization.Contents
- Assembly
- Stride.Core.Serialization.dll
Interface of the asset manager.
public interface IContentManager
- Extension Methods
Properties
Serializer
Gets the serializer.
ContentSerializer Serializer { get; }
Property Value
- ContentSerializer
The serializer.
Methods
Exists(string)
Check if the specified asset url exists.
bool Exists(string url)
Parameters
urlstringThe URL.
Returns
- bool
trueif the specified asset url exists,falseotherwise.
Get<T>(string)
Gets a previously loaded asset from its URL.
T Get<T>(string url) where T : class
Parameters
urlstringThe URL of the asset to retrieve.
Returns
- T
The loaded asset, or
nullif the asset has not been loaded.
Type Parameters
TThe type of asset to retrieve.
Remarks
This function does not increase the reference count on the asset.
IsLoaded(string, bool)
Gets whether an asset with the given URL is currently loaded.
bool IsLoaded(string url, bool loadedManuallyOnly = false)
Parameters
urlstringThe URL to check.
loadedManuallyOnlyboolIf
true, this method will return true only if an asset with the given URL has been manually loaded via Load<T>(string, ContentManagerLoaderSettings), and not if the asset has been only loaded indirectly from another asset.
Returns
- bool
Trueif an asset with the given URL is currently loaded,falseotherwise.
LoadAsync<T>(string, ContentManagerLoaderSettings)
Loads content from the specified URL asynchronously.
Task<T> LoadAsync<T>(string url, ContentManagerLoaderSettings settings = null) where T : class
Parameters
urlstringThe URL to load from.
settingsContentManagerLoaderSettingsThe settings. If null, fallback to Default.
Returns
- Task<T>
Type Parameters
TThe content type.
Load<T>(string, ContentManagerLoaderSettings)
Loads content from the specified URL.
T Load<T>(string url, ContentManagerLoaderSettings settings = null) where T : class
Parameters
urlstringThe URL to load from.
settingsContentManagerLoaderSettingsThe settings. If null, fallback to Default.
Returns
- T
Type Parameters
TThe content type.
OpenAsStream(string, StreamFlags)
Opens the specified URL as a stream used for custom raw asset loading.
Stream OpenAsStream(string url, StreamFlags streamFlags = StreamFlags.None)
Parameters
urlstringThe URL to the raw asset.
streamFlagsStreamFlagsThe type of stream needed
Returns
- Stream
A stream to the raw asset.
Unload(object)
Unloads the specified object.
void Unload(object obj)
Parameters
objobjectThe object to unload.
Unload(string)
Unloads the asset at the specified URL.
void Unload(string url)
Parameters
urlstringThe URL.