docs.unity3d.com
    Show / Hide Table of Contents

    Class ResourceLocationBase

    Basic implementation of IResourceLocation

    Inheritance
    Object
    ResourceLocationBase
    Inherited Members
    Object.Equals(Object)
    Object.Equals(Object, Object)
    Object.ReferenceEquals(Object, Object)
    Object.GetHashCode()
    Object.GetType()
    Object.MemberwiseClone()
    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

    The type of the object to provide.

    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
    IResourceLocation.Data

    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
    IResourceLocation.Dependencies

    DependencyHashCode

    Precomputed hash code of dependencies.

    Declaration
    public int DependencyHashCode { get; }
    Property Value
    Type Description
    Int32
    Implements
    IResourceLocation.DependencyHashCode

    HasDependencies

    Convenience method to see if there are any dependencies.

    Declaration
    public bool HasDependencies { get; }
    Property Value
    Type Description
    Boolean
    Implements
    IResourceLocation.HasDependencies

    InternalId

    Internal id.

    Declaration
    public string InternalId { get; }
    Property Value
    Type Description
    String
    Implements
    IResourceLocation.InternalId

    PrimaryKey

    Primary address for this location.

    Declaration
    public string PrimaryKey { get; set; }
    Property Value
    Type Description
    String
    Implements
    IResourceLocation.PrimaryKey

    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
    IResourceLocation.ProviderId

    ResourceType

    The type of the resource for th location.

    Declaration
    public Type ResourceType { get; }
    Property Value
    Type Description
    Type
    Implements
    IResourceLocation.ResourceType

    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
    IResourceLocation.Hash(Type)

    ToString()

    Returns the Internal name used by the provider to load this location

    Declaration
    public override string ToString()
    Returns
    Type Description
    String
    Overrides
    Object.ToString()
    Back to top
    Terms of use
    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