Interface IInstanceProvider
Interface that provides instances of objects. This is used in ResourceManager.Instantiate* calls.
Namespace: UnityEngine.ResourceManagement
Syntax
public interface IInstanceProvider
Methods
CanProvideInstance<TObject>(IResourceProvider, IResourceLocation)
Determind whether or not this provider can provide for the given loadProvider and location
Declaration
bool CanProvideInstance<TObject>(IResourceProvider loadProvider, IResourceLocation location)where TObject : Object
Parameters
Type | Name | Description |
---|---|---|
IResourceProvider | loadProvider | Provider used to load the object prefab. |
IResourceLocation | location | Location to instantiate. |
Returns
Type | Description |
---|---|
System.Boolean |
|
Type Parameters
Name | Description |
---|---|
TObject | Object type. |
ProvideInstanceAsync<TObject>(IResourceProvider, IResourceLocation, IAsyncOperation<IList<Object>>, InstantiationParameters)
Asynchronously instantiate the given location
Declaration
IAsyncOperation<TObject> ProvideInstanceAsync<TObject>(IResourceProvider loadProvider, IResourceLocation location, IAsyncOperation<IList<object>> loadDependencyOperation, InstantiationParameters instantiateParameters)where TObject : Object
Parameters
Type | Name | Description |
---|---|---|
IResourceProvider | loadProvider | Provider used to load the object prefab. |
IResourceLocation | location | Location to instantiate. |
IAsyncOperation<System.Collections.Generic.IList<System.Object>> | loadDependencyOperation | Async operation for dependency loading. |
InstantiationParameters | instantiateParameters |
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. |
UnityEngine.Object | instance | Object instance to release. |
Returns
Type | Description |
---|---|
System.Boolean |
|