Table of Contents

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

url string

The URL.

Returns

bool

true if the specified asset url exists, false otherwise.

Get<T>(string)

Gets a previously loaded asset from its URL.

T Get<T>(string url) where T : class

Parameters

url string

The URL of the asset to retrieve.

Returns

T

The loaded asset, or null if 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

url string

The URL to check.

loadedManuallyOnly bool

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

True if an asset with the given URL is currently loaded, false otherwise.

LoadAsync<T>(string, ContentManagerLoaderSettings)

Loads content from the specified URL asynchronously.

Task<T> LoadAsync<T>(string url, ContentManagerLoaderSettings settings = null) where T : class

Parameters

url string

The URL to load from.

settings ContentManagerLoaderSettings

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 : class

Parameters

url string

The URL to load from.

settings ContentManagerLoaderSettings

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

url string

The URL to the raw asset.

streamFlags StreamFlags

The type of stream needed

Returns

Stream

A stream to the raw asset.

Unload(object)

Unloads the specified object.

void Unload(object obj)

Parameters

obj object

The object to unload.

Unload(string)

Unloads the asset at the specified URL.

void Unload(string url)

Parameters

url string

The URL.