Class ResourceLocationBase | Package Manager UI website
docs.unity3d.com
    Show / Hide Table of Contents

    Class ResourceLocationBase

    Basic implementation of IResourceLocation

    Inheritance
    System.Object
    ResourceLocationBase
    Namespace: UnityEngine.ResourceManagement.ResourceLocations
    Syntax
    public class ResourceLocationBase : IResourceLocation

    Constructors

    ResourceLocationBase(String, String, String, IResourceLocation[])

    Construct a new ResourceLocationBase.

    Declaration
    public ResourceLocationBase(string name, string id, string providerId, params IResourceLocation[] dependencies)
    Parameters
    Type Name Description
    System.String name

    The name of the location. This is usually set to the primary key, or "address" of the location.

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

    System.String providerId

    The provider id. This is set to the FullName of the type of the provder class.

    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
    System.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
    System.Collections.Generic.IList<IResourceLocation>
    Implements
    IResourceLocation.Dependencies

    DependencyHashCode

    Precomputed hash code of dependencies.

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

    HasDependencies

    Convenience method to see if there are any dependencies.

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

    InternalId

    Internal id.

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

    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
    System.String
    Implements
    IResourceLocation.ProviderId

    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
    System.Type t

    The type to hash with.

    Returns
    Type Description
    System.Int32

    The combined hash code of the location and type.

    Implements
    IResourceLocation.Hash(Type)

    ToString()

    Returns the name of the location. This is usally set to the primary key of the location, or its "address".

    Declaration
    public override string ToString()
    Returns
    Type Description
    System.String
    Overrides
    System.Object.ToString()
    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