Class ResourceLocationBase
Basic implementation of IResourceLocation
Inherited Members
Namespace: UnityEngine.ResourceManagement.ResourceLocations
Syntax
public class ResourceLocationBase : IResourceLocation
Constructors
ResourceLocationBase(String, String, String, Type, IResourceLocation[])
Construct a new ResourceLocationBase.
Declaration
public ResourceLocationBase(string name, string id, string providerId, Type t, params IResourceLocation[] dependencies)
Parameters
Type | Name | Description |
---|---|---|
String | name | The name of the location. This is usually set to the primary key, or "address" of the location. |
String | id | The internal id of the location. This is used by the IResourceProvider to identify the object to provide. For example this may contain the file path or url of an asset. |
String | providerId | The provider id. This is set to the FullName of the type of the provder class. |
Type | t | |
IResourceLocation[] | dependencies | Locations for the dependencies of this location. |
Properties
Data
Data that is intended for the provider. Objects can be serialized during the build process to be used by the provider. An example of usage is cache usage data for AssetBundleProvider.
Declaration
public object Data { get; set; }
Property Value
Type | Description |
---|---|
Object |
Implements
Dependencies
List of dependencies that must be loaded before this location. This value may be null.
Declaration
public IList<IResourceLocation> Dependencies { get; }
Property Value
Type | Description |
---|---|
IList<IResourceLocation> |
Implements
DependencyHashCode
Precomputed hash code of dependencies.
Declaration
public int DependencyHashCode { get; }
Property Value
Type | Description |
---|---|
Int32 |
Implements
HasDependencies
Convenience method to see if there are any dependencies.
Declaration
public bool HasDependencies { get; }
Property Value
Type | Description |
---|---|
Boolean |
Implements
InternalId
Internal id.
Declaration
public string InternalId { get; }
Property Value
Type | Description |
---|---|
String |
Implements
PrimaryKey
Primary address for this location.
Declaration
public string PrimaryKey { get; set; }
Property Value
Type | Description |
---|---|
String |
Implements
ProviderId
Provider Id. This is usually set to the FullName property of the type of the provider class.
Declaration
public string ProviderId { get; }
Property Value
Type | Description |
---|---|
String |
Implements
ResourceType
The type of the resource for th location.
Declaration
public Type ResourceType { get; }
Property Value
Type | Description |
---|---|
Type |
Implements
Methods
ComputeDependencyHash()
Compute the dependency hash for this location
Declaration
public void ComputeDependencyHash()
Hash(Type)
Compute the hash of this location for the specified type.
Declaration
public int Hash(Type t)
Parameters
Type | Name | Description |
---|---|---|
Type | t | The type to hash with. |
Returns
Type | Description |
---|---|
Int32 | The combined hash code of the location and type. |
Implements
ToString()
Returns the Internal name used by the provider to load this location
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
String |