Class ResourceProviderBase
Base class for IResourceProvider.
Inheritance
System.Object
ResourceProviderBase
Namespace: UnityEngine.ResourceManagement.ResourceProviders
Syntax
public abstract class ResourceProviderBase : IResourceProvider, IInitializableObject
Fields
m_BehaviourFlags
Declaration
protected ProviderBehaviourFlags m_BehaviourFlags
Field Value
Type | Description |
---|---|
ProviderBehaviourFlags |
m_ProviderId
Declaration
protected string m_ProviderId
Field Value
Type | Description |
---|---|
System.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 |
---|---|
System.String | The provider identifier. |
Implements
Methods
CanProvide<TObject>(IResourceLocation)
Evaluate whether or not the provider can load the given location.
Declaration
public virtual 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. |
Implements
Initialize(String, String)
Initialize a constructed object.
Declaration
public virtual bool Initialize(string id, string data)
Parameters
Type | Name | Description |
---|---|---|
System.String | id | The id of the object. |
System.String | data | Serialized data for the object. |
Returns
Type | Description |
---|---|
System.Boolean | The result of the initialization. |
Implements
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
public abstract IAsyncOperation<TObject> Provide<TObject>(IResourceLocation location, IList<object> deps)
where TObject : class
Parameters
Type | Name | Description |
---|---|---|
IResourceLocation | location | Location to load. |
System.Collections.Generic.IList<System.Object> | deps |
Returns
Type | Description |
---|---|
IAsyncOperation<TObject> | An asynchronous operation to load the object. |
Type Parameters
Name | Description |
---|---|
TObject | Object type to be loaded and returned. |
Implements
Release(IResourceLocation, Object)
Declaration
public virtual bool Release(IResourceLocation location, object asset)
Parameters
Type | Name | Description |
---|---|---|
IResourceLocation | location | |
System.Object | asset |
Returns
Type | Description |
---|---|
System.Boolean |
Implements
ToString()
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
System.String |
Overrides
System.Object.ToString()
Explicit Interface Implementations
IResourceProvider.BehaviourFlags
Declaration
ProviderBehaviourFlags IResourceProvider.BehaviourFlags { get; }
Returns
Type | Description |
---|---|
ProviderBehaviourFlags |