Class ResourceLocationMap
Simple implementation of an IResourceLocator
Inheritance
System.Object
ResourceLocationMap
Inherited Members
System.Object.ToString()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
Namespace: UnityEngine.AddressableAssets
Syntax
public class ResourceLocationMap : IResourceLocator
Constructors
ResourceLocationMap(IList<ResourceLocationData>)
Construct a new ResourceLocationMap object with a list of locations.
Declaration
public ResourceLocationMap(IList<ResourceLocationData> locations)
Parameters
| Type | Name | Description | 
|---|---|---|
| System.Collections.Generic.IList<ResourceLocationData> | locations | The list of locations to initialize with.  | 
ResourceLocationMap(Int32)
Construct a new ResourceLocationMap object.
Declaration
public ResourceLocationMap(int capacity = 0)
Parameters
| Type | Name | Description | 
|---|---|---|
| System.Int32 | capacity | The expected number of items.  | 
Properties
Locations
The mapping of key to location lists.
Declaration
public Dictionary<object, IList<IResourceLocation>> Locations { get; }
Property Value
| Type | Description | 
|---|---|
| System.Collections.Generic.Dictionary<System.Object, System.Collections.Generic.IList<IResourceLocation>> | 
Methods
Add(Object, IResourceLocation)
Add a new location.
Declaration
public void Add(object key, IResourceLocation location)
Parameters
| Type | Name | Description | 
|---|---|---|
| System.Object | key | The key to reference the location.  | 
| IResourceLocation | location | The location to add.  | 
Add(Object, IList<IResourceLocation>)
Add a list of locations.
Declaration
public void Add(object key, IList<IResourceLocation> locations)
Parameters
| Type | Name | Description | 
|---|---|---|
| System.Object | key | The key to reference the locations with.  | 
| System.Collections.Generic.IList<IResourceLocation> | locations | The list of locations to store at the given key.  | 
Locate(Object, out IList<IResourceLocation>)
Locate all of the locations that match the given key.
Declaration
public bool Locate(object key, out IList<IResourceLocation> locations)
Parameters
| Type | Name | Description | 
|---|---|---|
| System.Object | key | The key used to locate the locations.  | 
| System.Collections.Generic.IList<IResourceLocation> | locations | The list of found locations. This list is shared so it should not be modified.  | 
Returns
| Type | Description | 
|---|---|
| System.Boolean |