Class ResourceLocationMap | Package Manager UI website
docs.unity.cn
    Show / Hide Table of Contents

    Class ResourceLocationMap

    Simple implementation of an IResourceLocator

    Inheritance
    System.Object
    ResourceLocationMap
    Namespace: UnityEngine.AddressableAssets.ResourceLocators
    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

    Keys

    The keys available in this locator.

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

    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, 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.

    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.

    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
    Implements
    IResourceLocator.Locate(Object, out IList<IResourceLocation>)
    Back to top Copyright © 2015-2018 Unity
    Generated by DocFX