Stride

OPEN / CLOSE
  • Features
  • Blog
  • Documentation
  • Community
(icon) Download

  • Discord
  • Facebook
  • Twitter
  • YouTube

LANGUAGE

OPEN / CLOSE
  • English
  • 日本語
    Show / Hide Table of Contents

    IContentManager Interface

    Namespace: Stride.Core.Serialization.Contents
    Assembly: 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.

    | Improve this Doc View Source

    Properties


    Serializer

    Gets the serializer.

    ContentSerializer Serializer { get; }
    Property Value
    Type Description
    ContentSerializer

    The serializer.

    | Improve this Doc View Source

    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

    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
    Type Name Description
    System.String url

    The URL of the asset to retrieve.

    Returns
    Type Description
    T

    The loaded asset, or null if the asset has not been loaded.

    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 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
    Type Description
    System.Boolean

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


    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.


    Extension Methods

    ComponentBaseExtensions.DisposeBy<T>(T, ICollectorHolder)
    ComponentBaseExtensions.RemoveDisposeBy<T>(T, ICollectorHolder)
    UrlReferenceContentManagerExtenstions.Exists(IContentManager, IUrlReference)
    UrlReferenceContentManagerExtenstions.OpenAsStream(IContentManager, UrlReference, StreamFlags)
    UrlReferenceContentManagerExtenstions.Load<T>(IContentManager, UrlReference<T>, ContentManagerLoaderSettings)
    UrlReferenceContentManagerExtenstions.LoadAsync<T>(IContentManager, UrlReference<T>, ContentManagerLoaderSettings)
    UrlReferenceContentManagerExtenstions.Get<T>(IContentManager, UrlReference<T>)
    UrlReferenceContentManagerExtenstions.IsLoaded(IContentManager, IUrlReference, Boolean)
    UrlReferenceContentManagerExtenstions.Unload(IContentManager, IUrlReference)
    • Improve this Doc
    • View Source
    In This Article

    Back to top

    Copyright © 2019-2021 .NET Foundation and Contributors
    Supported by the .NET Foundation