Class ResourceProviderBase
Base class for IResourceProvider.
Namespace: UnityEngine.ResourceManagement.ResourceProviders
Syntax
public abstract class ResourceProviderBase : object, IResourceProvider, IInitializableObject
Fields
m_BehaviourFlags
The extra behavior of the provider.
Declaration
protected ProviderBehaviourFlags m_BehaviourFlags
Field Value
| Type | Description |
|---|---|
| ProviderBehaviourFlags |
m_ProviderId
The unique identifier of the provider.
Declaration
protected string m_ProviderId
Field Value
| Type | Description |
|---|---|
| String |
Properties
ProviderId
Unique identifier for this provider, used by Resource Locations to find a suitable Provider
Declaration
public virtual string ProviderId { get; }
Property Value
| Type | Description |
|---|---|
| String | The provider identifier. |
Implements
Methods
CanProvide(Type, IResourceLocation)
Determine if this provider can provide the specified object type from the specified location.
Declaration
public virtual bool CanProvide(Type t, IResourceLocation location)
Parameters
| Type | Name | Description |
|---|---|---|
| Type | t | |
| IResourceLocation | location | The resource location of the object. |
Returns
| Type | Description |
|---|---|
| Boolean | True if this provider can create the specified object. |
Implements
GetDefaultType(IResourceLocation)
Get the default type of object that this provider can provide.
Declaration
public virtual Type GetDefaultType(IResourceLocation location)
Parameters
| Type | Name | Description |
|---|---|---|
| IResourceLocation | location |
Returns
| Type | Description |
|---|---|
| Type |
Implements
Initialize(String, String)
Initialize a constructed object.
Declaration
public virtual bool Initialize(string id, string data)
Parameters
| Type | Name | Description |
|---|---|---|
| String | id | The id of the object. |
| String | data | Serialized data for the object. |
Returns
| Type | Description |
|---|---|
| Boolean | The result of the initialization. |
Implements
InitializeAsync(ResourceManager, String, String)
Async operation for initializing a constructed object.
Declaration
public virtual AsyncOperationHandle<bool> InitializeAsync(ResourceManager rm, string id, string data)
Parameters
| Type | Name | Description |
|---|---|---|
| ResourceManager | rm | The current instance of Resource Manager. |
| String | id | The id of the object. |
| String | data | Serialized data for the object. |
Returns
| Type | Description |
|---|---|
| AsyncOperationHandle<Boolean> | Async operation |
Implements
Provide(ProvideHandle)
Provide the object specified in the provideHandle.
Declaration
public abstract void Provide(ProvideHandle provideHandle)
Parameters
| Type | Name | Description |
|---|---|---|
| ProvideHandle | provideHandle | Contains all data needed to provide the requested object. |
Implements
Release(IResourceLocation, Object)
Release the specified object that was created from the specified location.
Declaration
public virtual void Release(IResourceLocation location, object obj)
Parameters
| Type | Name | Description |
|---|---|---|
| IResourceLocation | location | The location of the object |
| Object | obj | The object to release. |
Implements
ToString()
Converts information about the resource provider to a formatted string.
Declaration
public override string ToString()
Returns
| Type | Description |
|---|---|
| String | Returns information about the resource provider. |
Explicit Interface Implementations
IResourceProvider.BehaviourFlags
Declaration
ProviderBehaviourFlags IResourceProvider.BehaviourFlags { get; }
Returns
| Type | Description |
|---|---|
| ProviderBehaviourFlags |