Interface IInstanceProvider | Package Manager UI website
docs.unity.cn
    Show / Hide Table of Contents

    Interface IInstanceProvider

    Interface that provides instances of objects. This is used in ResourceManager.Instantiate* calls.

    Namespace: UnityEngine.ResourceManagement.ResourceProviders
    Syntax
    public interface IInstanceProvider

    Methods

    CanProvideInstance<TObject>(IResourceProvider, IResourceLocation)

    Determine whether or not this provider can provide for the given loadProvider and location

    Declaration
    bool CanProvideInstance<TObject>(IResourceProvider loadProvider, IResourceLocation location)
    Parameters
    Type Name Description
    IResourceProvider loadProvider

    Provider used to load the object prefab.

    IResourceLocation location

    Location to instantiate.

    Returns
    Type Description
    System.Boolean

    true, if provide instance was caned, false otherwise.

    Type Parameters
    Name Description
    TObject

    Object type.

    ProvideInstanceAsync<TObject>(IResourceProvider, IResourceLocation, IList<Object>, InstantiationParameters)

    Asynchronously instantiate the given location

    Declaration
    IAsyncOperation<TObject> ProvideInstanceAsync<TObject>(IResourceProvider loadProvider, IResourceLocation location, IList<object> deps, InstantiationParameters instantiateParameters)
    Parameters
    Type Name Description
    IResourceProvider loadProvider

    Provider used to load the object prefab.

    IResourceLocation location

    Location to instantiate.

    System.Collections.Generic.IList<System.Object> deps
    InstantiationParameters instantiateParameters

    Parameters to be used by Unity's GameObject.Instantiate method

    Returns
    Type Description
    IAsyncOperation<TObject>

    An async operation.

    Type Parameters
    Name Description
    TObject

    Instantiated object type.

    ReleaseInstance(IResourceProvider, IResourceLocation, Object)

    Releases the instance.

    Declaration
    bool ReleaseInstance(IResourceProvider loadProvider, IResourceLocation location, object instance)
    Parameters
    Type Name Description
    IResourceProvider loadProvider

    Provider used to load the object prefab.

    IResourceLocation location

    Location to release.

    System.Object instance

    Object instance to release.

    Returns
    Type Description
    System.Boolean

    true, if instance was released, false otherwise.

    Back to top Copyright © 2015-2018 Unity
    Generated by DocFX