Class ResourceProviderBase | Package Manager UI website
docs.unity3d.com
    Show / Hide Table of Contents

    Class ResourceProviderBase

    Base class for IResourceProvider.

    Inheritance
    System.Object
    ResourceProviderBase
    ContentCatalogProvider
    AssetBundleProvider
    BundledAssetProvider
    AssetBundleProviderRemoteWebRequest
    RemoteTextureProvider
    LegacyResourcesProvider
    RawDataProvider
    Namespace: UnityEngine.ResourceManagement.ResourceProviders
    Syntax
    public abstract class ResourceProviderBase : IResourceProvider, IInitializableObject

    Fields

    m_BehaviourFlags

    Declaration
    protected ProviderBehaviourFlags m_BehaviourFlags
    Field Value
    Type Description
    ProviderBehaviourFlags

    m_ProviderId

    Declaration
    protected string m_ProviderId
    Field Value
    Type Description
    System.String

    Properties

    ProviderId

    Unique identifier for this provider, used by Resource Locations to find a suitable Provider

    Declaration
    public virtual string ProviderId { get; }
    Property Value
    Type Description
    System.String

    The provider identifier.

    Implements
    IResourceProvider.ProviderId

    Methods

    CanProvide<TObject>(IResourceLocation)

    Evaluate whether or not the provider can load the given location.

    Declaration
    public virtual bool CanProvide<TObject>(IResourceLocation location)
        where TObject : class
    Parameters
    Type Name Description
    IResourceLocation location

    Location to evaluate.

    Returns
    Type Description
    System.Boolean

    true, if provide can load the location. false otherwise.

    Type Parameters
    Name Description
    TObject

    The object type for the given location.

    Implements
    IResourceProvider.CanProvide<TObject>(IResourceLocation)

    Initialize(String, String)

    Initialize a constructed object.

    Declaration
    public virtual bool Initialize(string id, string data)
    Parameters
    Type Name Description
    System.String id

    The id of the object.

    System.String data

    Serialized data for the object.

    Returns
    Type Description
    System.Boolean

    The result of the initialization.

    Implements
    IInitializableObject.Initialize(String, String)

    Provide<TObject>(IResourceLocation, IList<Object>)

    Synchronously load the resource at the given location. An asynchronous load operation for any dependencies should be passed as an argument.

    Declaration
    public abstract IAsyncOperation<TObject> Provide<TObject>(IResourceLocation location, IList<object> deps)
        where TObject : class
    Parameters
    Type Name Description
    IResourceLocation location

    Location to load.

    System.Collections.Generic.IList<System.Object> deps
    Returns
    Type Description
    IAsyncOperation<TObject>

    An asynchronous operation to load the object.

    Type Parameters
    Name Description
    TObject

    Object type to be loaded and returned.

    Implements
    IResourceProvider.Provide<TObject>(IResourceLocation, IList<Object>)

    Release(IResourceLocation, Object)

    Declaration
    public virtual bool Release(IResourceLocation location, object asset)
    Parameters
    Type Name Description
    IResourceLocation location
    System.Object asset
    Returns
    Type Description
    System.Boolean
    Implements
    IResourceProvider.Release(IResourceLocation, Object)

    ToString()

    Declaration
    public override string ToString()
    Returns
    Type Description
    System.String
    Overrides
    System.Object.ToString()

    Explicit Interface Implementations

    IResourceProvider.BehaviourFlags

    Declaration
    ProviderBehaviourFlags IResourceProvider.BehaviourFlags { get; }
    Returns
    Type Description
    ProviderBehaviourFlags
    Implements
    IResourceProvider.BehaviourFlags
    Back to top
    Copyright © 2023 Unity Technologies — Terms of use
    • Legal
    • Privacy Policy
    • Cookies
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)
    "Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
    Generated by DocFX on 18 October 2023