Class ResourceLocationMap | Addressables | 1.13.1
docs.unity3d.com
    Show / Hide Table of Contents

    Class ResourceLocationMap

    Simple implementation of an IResourceLocator

    Inheritance
    Object
    ResourceLocationMap
    Inherited Members
    Object.ToString()
    Object.Equals(Object)
    Object.Equals(Object, Object)
    Object.ReferenceEquals(Object, Object)
    Object.GetHashCode()
    Object.GetType()
    Object.MemberwiseClone()
    Namespace: UnityEngine.AddressableAssets.ResourceLocators
    Syntax
    public class ResourceLocationMap : IResourceLocator

    Constructors

    ResourceLocationMap(String, IList<ResourceLocationData>)

    Construct a new ResourceLocationMap object with a list of locations.

    Declaration
    public ResourceLocationMap(string id, IList<ResourceLocationData> locations)
    Parameters
    Type Name Description
    String id
    IList<ResourceLocationData> locations

    The list of locations to initialize with.

    ResourceLocationMap(String, Int32)

    Construct a new ResourceLocationMap object.

    Declaration
    public ResourceLocationMap(string id, int capacity = 0)
    Parameters
    Type Name Description
    String id
    Int32 capacity

    The expected number of items.

    Properties

    Keys

    The keys available in this locator.

    Declaration
    public IEnumerable<object> Keys { get; }
    Property Value
    Type Description
    IEnumerable<Object>
    Implements
    IResourceLocator.Keys

    Locations

    The mapping of key to location lists.

    Declaration
    public Dictionary<object, IList<IResourceLocation>> Locations { get; }
    Property Value
    Type Description
    Dictionary<Object, IList<IResourceLocation>>

    LocatorId

    Declaration
    public string LocatorId { get; }
    Property Value
    Type Description
    String
    Implements
    IResourceLocator.LocatorId

    Methods

    Add(Object, IList<IResourceLocation>)

    Add a list of locations.

    Declaration
    public void Add(object key, IList<IResourceLocation> locations)
    Parameters
    Type Name Description
    Object key

    The key to reference the locations with.

    IList<IResourceLocation> locations

    The list of locations to store at the given key.

    Add(Object, IResourceLocation)

    Add a new location.

    Declaration
    public void Add(object key, IResourceLocation location)
    Parameters
    Type Name Description
    Object key

    The key to reference the location.

    IResourceLocation location

    The location to add.

    Locate(Object, Type, out IList<IResourceLocation>)

    Locate all of the locations that match the given key.

    Declaration
    public bool Locate(object key, Type type, out IList<IResourceLocation> locations)
    Parameters
    Type Name Description
    Object key

    The key used to locate the locations.

    Type type
    IList<IResourceLocation> locations

    The list of found locations. This list is shared so it should not be modified.

    Returns
    Type Description
    Boolean
    Implements
    IResourceLocator.Locate(Object, Type, out IList<IResourceLocation>)
    Back to top
    Copyright © 2023 Unity Technologies — Terms of use
    • Legal
    • Privacy Policy
    • Cookies
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)
    "Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
    Generated by DocFX on 18 October 2023