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
    LegacyResourcesProvider
    TextDataProvider
    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(Type, IResourceLocation)

    Determine if this provider can provide the specified object type from the specified location.

    Declaration
    public virtual bool CanProvide(Type t, IResourceLocation location)
    Parameters
    Type Name Description
    System.Type t
    IResourceLocation location

    The resource location of the object.

    Returns
    Type Description
    System.Boolean

    True if this provider can create the specified object.

    Implements
    IResourceProvider.CanProvide(Type, IResourceLocation)

    GetDefaultType(IResourceLocation)

    Get the default type of object that this provider can provide.

    Declaration
    public virtual Type GetDefaultType(IResourceLocation location)
    Parameters
    Type Name Description
    IResourceLocation location
    Returns
    Type Description
    System.Type
    Implements
    IResourceProvider.GetDefaultType(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(ProvideHandle)

    Provide the object specified in the provideHandle.

    Declaration
    public abstract void Provide(ProvideHandle provideHandle)
    Parameters
    Type Name Description
    ProvideHandle provideHandle

    Contains all data needed to provide the requested object.

    Implements
    IResourceProvider.Provide(ProvideHandle)

    Release(IResourceLocation, Object)

    Release the specified object that was created from the specified location.

    Declaration
    public virtual void Release(IResourceLocation location, object obj)
    Parameters
    Type Name Description
    IResourceLocation location

    The location of the object

    System.Object obj

    The object to release.

    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