Interface IResourceProvider
Resoure Providers handle loading (Provide) and unloading (Release) of objects
Inherited Members
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 |
|
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 |
|