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
- urlstring
- The 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 : classParameters
- urlstring
- The URL of the asset to retrieve. 
Returns
- T
- The loaded asset, or - nullif the asset has not been loaded.
Type Parameters
- T
- The 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
- urlstring
- The URL to check. 
- loadedManuallyOnlybool
- If - 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 : classParameters
- urlstring
- The URL to load from. 
- settingsContentManagerLoaderSettings
- The settings. If null, fallback to Default. 
Returns
- Task<T>
Type Parameters
- T
- The content type. 
Load<T>(string, ContentManagerLoaderSettings?)
Loads content from the specified URL.
T Load<T>(string url, ContentManagerLoaderSettings? settings = null) where T : classParameters
- urlstring
- The URL to load from. 
- settingsContentManagerLoaderSettings
- The settings. If null, fallback to Default. 
Returns
- T
Type Parameters
- T
- The 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
- urlstring
- The URL to the raw asset. 
- streamFlagsStreamFlags
- The type of stream needed 
Returns
- Stream
- A stream to the raw asset. 
Unload(object)
Unloads the specified object.
void Unload(object obj)Parameters
- objobject
- The object to unload. 
Unload(string)
Unloads the asset at the specified URL.
void Unload(string url)Parameters
- urlstring
- The URL.