IContentManager Interface
Namespace: Stride.Core.Serialization.ContentsAssembly: Stride.Core.Serialization.dll
Interface of the asset manager.
public interface IContentManager
Name | Description | |
---|---|---|
Properties | ||
Serializer | Gets the serializer. |
|
Methods | ||
Exists(String) | Check if the specified asset url exists. |
|
Get<T>(String) | Gets a previously loaded asset from its URL. |
|
IsLoaded(String, Boolean) | Gets whether an asset with the given URL is currently loaded. |
|
Load<T>(String, ContentManagerLoaderSettings) | Loads content from the specified URL. |
|
LoadAsync<T>(String, ContentManagerLoaderSettings) | Loads content from the specified URL asynchronously. |
|
OpenAsStream(String, StreamFlags) | Opens the specified URL as a stream used for custom raw asset loading. |
|
Unload(Object) | Unloads the specified object. |
|
Unload(String) | Unloads the asset at the specified URL. |
Properties
Serializer
Gets the serializer.
ContentSerializer Serializer { get; }
Property Value
Type | Description |
---|---|
ContentSerializer | The serializer. |
Methods
Exists(String)
Check if the specified asset url exists.
bool Exists(string url)
Parameters
Type | Name | Description |
---|---|---|
System.String | url | The URL. |
Returns
Type | Description |
---|---|
System.Boolean |
|
Get<T>(String)
Gets a previously loaded asset from its URL.
T Get<T>(string url)
where T : class
Parameters
Type | Name | Description |
---|---|---|
System.String | url | The URL of the asset to retrieve. |
Returns
Type | Description |
---|---|
T | The loaded asset, or |
Type Parameters
Name | Description |
---|---|
T | The type of asset to retrieve. |
Remarks
This function does not increase the reference count on the asset.
IsLoaded(String, Boolean)
Gets whether an asset with the given URL is currently loaded.
bool IsLoaded(string url, bool loadedManuallyOnly = false)
Parameters
Type | Name | Description |
---|---|---|
System.String | url | The URL to check. |
System.Boolean | loadedManuallyOnly | If |
Returns
Type | Description |
---|---|
System.Boolean |
|
Load<T>(String, ContentManagerLoaderSettings)
Loads content from the specified URL.
T Load<T>(string url, ContentManagerLoaderSettings settings = null)
where T : class
Parameters
Type | Name | Description |
---|---|---|
System.String | url | The URL to load from. |
ContentManagerLoaderSettings | settings | The settings. If null, fallback to Default. |
Returns
Type | Description |
---|---|
T |
Type Parameters
Name | Description |
---|---|
T | The content type. |
LoadAsync<T>(String, ContentManagerLoaderSettings)
Loads content from the specified URL asynchronously.
Task<T> LoadAsync<T>(string url, ContentManagerLoaderSettings settings = null)
where T : class
Parameters
Type | Name | Description |
---|---|---|
System.String | url | The URL to load from. |
ContentManagerLoaderSettings | settings | The settings. If null, fallback to Default. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<T> |
Type Parameters
Name | Description |
---|---|
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
Type | Name | Description |
---|---|---|
System.String | url | The URL to the raw asset. |
StreamFlags | streamFlags | The type of stream needed |
Returns
Type | Description |
---|---|
System.IO.Stream | A stream to the raw asset. |
Unload(Object)
Unloads the specified object.
void Unload(object obj)
Parameters
Type | Name | Description |
---|---|---|
System.Object | obj | The object to unload. |
Unload(String)
Unloads the asset at the specified URL.
void Unload(string url)
Parameters
Type | Name | Description |
---|---|---|
System.String | url | The URL. |