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

    Class AddressableAssetEntry

    Contains data for an addressable asset entry.

    Inheritance
    System.Object
    AddressableAssetEntry
    Namespace: UnityEditor.AddressableAssets.Settings
    Syntax
    [Serializable]
    public class AddressableAssetEntry : ISerializationCallbackReceiver

    Properties

    address

    The address of the entry. This is treated as the primary key in the ResourceManager system.

    Declaration
    public string address { get; set; }
    Property Value
    Type Description
    System.String

    AssetPath

    The path of the asset.

    Declaration
    public string AssetPath { get; }
    Property Value
    Type Description
    System.String

    guid

    The asset guid.

    Declaration
    public string guid { get; }
    Property Value
    Type Description
    System.String

    IsInResources

    Is the asset in a resource folder.

    Declaration
    public bool IsInResources { get; set; }
    Property Value
    Type Description
    System.Boolean

    IsInSceneList

    Is scene in scene list.

    Declaration
    public bool IsInSceneList { get; set; }
    Property Value
    Type Description
    System.Boolean

    IsScene

    Is this entry for a scene.

    Declaration
    public bool IsScene { get; }
    Property Value
    Type Description
    System.Boolean

    IsSubAsset

    Is a sub asset. For example an asset in an addressable folder.

    Declaration
    public bool IsSubAsset { get; set; }
    Property Value
    Type Description
    System.Boolean

    labels

    The set of labels for this entry. There is no inherent limit to the number of labels.

    Declaration
    public HashSet<string> labels { get; }
    Property Value
    Type Description
    HashSet<System.String>

    MainAsset

    The main asset object for this entry.

    Declaration
    public Object MainAsset { get; }
    Property Value
    Type Description
    UnityEngine.Object

    ParentEntry

    Declaration
    public AddressableAssetEntry ParentEntry { get; set; }
    Property Value
    Type Description
    AddressableAssetEntry

    parentGroup

    The asset group that this entry belongs to. An entry can only belong to a single group at a time.

    Declaration
    public AddressableAssetGroup parentGroup { get; set; }
    Property Value
    Type Description
    AddressableAssetGroup

    ReadOnly

    Read only state of the entry.

    Declaration
    public bool ReadOnly { get; set; }
    Property Value
    Type Description
    System.Boolean

    Methods

    CreateCatalogEntries(List<ContentCatalogDataEntry>, Boolean, String, IEnumerable<Object>, Object, HashSet<Type>)

    Create all entries for this addressable asset. This will expand subassets (Sprites, Meshes, etc) and also different representations.

    Declaration
    public void CreateCatalogEntries(List<ContentCatalogDataEntry> entries, bool isBundled, string providerType, IEnumerable<object> dependencies, object extraData, HashSet<Type> providerTypes)
    Parameters
    Type Name Description
    System.Collections.Generic.List<ContentCatalogDataEntry> entries

    The list of entries to fill in.

    System.Boolean isBundled

    Whether the entry is bundles or not. This will affect the load path.

    System.String providerType

    The provider type for the main entry.

    System.Collections.Generic.IEnumerable<System.Object> dependencies

    Keys of dependencies

    System.Object extraData

    Extra data to append to catalog entries.

    HashSet<System.Type> providerTypes

    Any unknown provider types are added to this set in order to ensure they are not stripped.

    CreateKeyList()

    Creates a list of keys that can be used to load this entry.

    Declaration
    public List<object> CreateKeyList()
    Returns
    Type Description
    System.Collections.Generic.List<System.Object>

    The list of keys. This will contain the address, the guid as a Hash128 if valid, all assigned labels, and the scene index if applicable.

    GatherAllAssets(List<AddressableAssetEntry>, Boolean, Boolean, Boolean, Func<AddressableAssetEntry, Boolean>)

    Gathers all asset entries. Each explicit entry may contain multiple sub entries. For example, addressable folders create entries for each asset contained within.

    Declaration
    public void GatherAllAssets(List<AddressableAssetEntry> assets, bool includeSelf, bool recurseAll, bool includeSubObjects, Func<AddressableAssetEntry, bool> entryFilter = null)
    Parameters
    Type Name Description
    System.Collections.Generic.List<AddressableAssetEntry> assets

    The generated list of entries. For simple entries, this will contain just the entry itself if specified.

    System.Boolean includeSelf

    Determines if the entry should be contained in the result list or just sub entries.

    System.Boolean recurseAll

    Determines if full recursion should be done when gathering entries.

    System.Boolean includeSubObjects

    Determines if sub objects such as sprites should be included.

    System.Func<AddressableAssetEntry, System.Boolean> entryFilter

    Optional predicate to run against each entry, only returning those that pass. A null filter will return all entries

    GetAssetLoadPath(Boolean)

    The asset load path. This is used to determine the internal id of resource locations.

    Declaration
    public string GetAssetLoadPath(bool isBundled)
    Parameters
    Type Name Description
    System.Boolean isBundled

    True if the asset will be contained in an asset bundle.

    Returns
    Type Description
    System.String

    Return the runtime path that should be used to load this entry.

    OnAfterDeserialize()

    Implementation of ISerializationCallbackReceiver. Converts data from serializable form after deserialization.

    Declaration
    public void OnAfterDeserialize()

    OnBeforeSerialize()

    Implementation of ISerializationCallbackReceiver. Converts data to serializable form before serialization.

    Declaration
    public void OnBeforeSerialize()

    SetAddress(String, Boolean)

    Set the address of the entry.

    Declaration
    public void SetAddress(string addr, bool postEvent = true)
    Parameters
    Type Name Description
    System.String addr

    The address.

    System.Boolean postEvent

    Post modification event.

    SetLabel(String, Boolean, Boolean, Boolean)

    Set or unset a label on this entry.

    Declaration
    public bool SetLabel(string label, bool enable, bool force = false, bool postEvent = true)
    Parameters
    Type Name Description
    System.String label

    The label name.

    System.Boolean enable

    Setting to true will add the label, false will remove it.

    System.Boolean force

    When enable is true, setting force to true will force the label to exist on the parent AddressableAssetSettings object if it does not already.

    System.Boolean postEvent

    Post modification event.

    Returns
    Type Description
    System.Boolean
    In This Article
    • Properties
      • address
      • AssetPath
      • guid
      • IsInResources
      • IsInSceneList
      • IsScene
      • IsSubAsset
      • labels
      • MainAsset
      • ParentEntry
      • parentGroup
      • ReadOnly
    • Methods
      • CreateCatalogEntries(List<ContentCatalogDataEntry>, Boolean, String, IEnumerable<Object>, Object, HashSet<Type>)
      • CreateKeyList()
      • GatherAllAssets(List<AddressableAssetEntry>, Boolean, Boolean, Boolean, Func<AddressableAssetEntry, Boolean>)
      • GetAssetLoadPath(Boolean)
      • OnAfterDeserialize()
      • OnBeforeSerialize()
      • SetAddress(String, Boolean)
      • SetLabel(String, Boolean, Boolean, Boolean)
    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