Interface IResourceProvider | Package Manager UI website
docs.unity3d.com
    Show / Hide Table of Contents

    Interface IResourceProvider

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

    Inherited Members
    IInitializableObject.Initialize(String, String)
    Namespace: UnityEngine.ResourceManagement.ResourceProviders
    Syntax
    public interface IResourceProvider : IInitializableObject

    Properties

    BehaviourFlags

    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
    System.String

    The provider identifier.

    Methods

    CanProvide<TObject>(IResourceLocation)

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

    Declaration
    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.

    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
    IAsyncOperation<TObject> Provide<TObject>(IResourceLocation location, IList<object> dependencies)
        where TObject : class
    Parameters
    Type Name Description
    IResourceLocation location

    Location to load.

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

    An asynchronous operation to load the object.

    Type Parameters
    Name Description
    TObject

    Object type to be loaded and returned.

    Release(IResourceLocation, Object)

    Release and/or unload the given resource location and asset

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

    Location to release.

    System.Object asset

    Asset to unload.

    Returns
    Type Description
    System.Boolean

    true, if release was successful. false otherwise.

    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