Class AddressableAssetEntry
Contains data for an addressable asset entry.
Inheritance
Namespace: UnityEditor.AddressableAssets
Syntax
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> |
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
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. |
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 address, bool postEvent = true)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | address | The address. |
| System.Boolean | postEvent | Post modification event. |
SetLabel(String, Boolean, Boolean)
Set or unset a label on this entry.
Declaration
public bool SetLabel(string label, bool val, bool postEvent = true)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | label | The label name. |
| System.Boolean | val | The value to set. Setting to true will add the label, false will remove it. |
| System.Boolean | postEvent | Post modification event. |
Returns
| Type | Description |
|---|---|
| System.Boolean |