Interface IResourceProvider | Addressables | 1.8.5
docs.unity.cn
    Show / Hide Table of Contents

    Interface IResourceProvider

    Resoure Providers handle loading (Provide) and unloading (Release) of objects

    Namespace: UnityEngine.ResourceManagement.ResourceProviders
    Syntax
    public interface IResourceProvider

    Properties

    BehaviourFlags

    Custom flags for the provider.

    Declaration
    ProviderBehaviourFlags BehaviourFlags { get; }
    Property Value
    Type Description
    ProviderBehaviourFlags

    ProviderId

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

    Declaration
    string ProviderId { get; }
    Property Value
    Type Description
    String

    The provider identifier.

    Methods

    CanProvide(Type, IResourceLocation)

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

    Declaration
    bool CanProvide(Type type, IResourceLocation location)
    Parameters
    Type Name Description
    Type type

    The type of object.

    IResourceLocation location

    The resource location of the object.

    Returns
    Type Description
    Boolean

    True if this provider can create the specified object.

    GetDefaultType(IResourceLocation)

    The default type of object that this provider can provide.

    Declaration
    Type GetDefaultType(IResourceLocation location)
    Parameters
    Type Name Description
    IResourceLocation location

    The location that can be used to determine the type.

    Returns
    Type Description
    Type

    The type of object that can be provided.

    Provide(ProvideHandle)

    Tells the provide that it needs to provide a resource and report the results through the passed provideHandle. When this is called, all dependencies have completed and are available through the provideHandle.

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

    A handle used to update the operation.

    Release(IResourceLocation, Object)

    Release and/or unload the given resource location and asset

    Declaration
    void Release(IResourceLocation location, object asset)
    Parameters
    Type Name Description
    IResourceLocation location

    Location to release.

    Object asset

    Asset to unload.

    Back to top Copyright © 2020 Unity Technologies
    Generated by DocFX
    on 01 September 2020