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

    Class AddressableAssetGroup

    Contains the collection of asset entries associated with this group.

    Inheritance
    System.Object
    AddressableAssetGroup
    Namespace: UnityEditor.AddressableAssets.Settings
    Syntax
    [Serializable]
    public class AddressableAssetGroup : ScriptableObject, IComparer<AddressableAssetEntry>, ISerializationCallbackReceiver

    Properties

    Default

    Is the default group.

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

    entries

    The collection of asset entries.

    Declaration
    public virtual ICollection<AddressableAssetEntry> entries { get; }
    Property Value
    Type Description
    System.Collections.Generic.ICollection<AddressableAssetEntry>

    Guid

    The group GUID.

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

    Name

    The group name.

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

    ReadOnly

    Is this group read only. This is normally false. Built in resources (resource folders and the scene list) are put into a special read only group.

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

    Schemas

    List of schemas for this group.

    Declaration
    public List<AddressableAssetGroupSchema> Schemas { get; }
    Property Value
    Type Description
    System.Collections.Generic.List<AddressableAssetGroupSchema>

    SchemaTypes

    Get the types of added schema for this group.

    Declaration
    public List<Type> SchemaTypes { get; }
    Property Value
    Type Description
    System.Collections.Generic.List<System.Type>

    Settings

    The AddressableAssetSettings that this group belongs to.

    Declaration
    public AddressableAssetSettings Settings { get; }
    Property Value
    Type Description
    AddressableAssetSettings

    Methods

    AddSchema(Type, Boolean)

    Creates and adds a schema of a given type to this group. The schema asset will be created in the GroupSchemas directory relative to the settings asset.

    Declaration
    public AddressableAssetGroupSchema AddSchema(Type type, bool postEvent = true)
    Parameters
    Type Name Description
    System.Type type

    The schema type. This type must not already be added.

    System.Boolean postEvent

    Determines if this method call will post an event to the internal addressables event system

    Returns
    Type Description
    AddressableAssetGroupSchema

    The created schema object.

    AddSchema(AddressableAssetGroupSchema, Boolean)

    Adds a copy of the provided schema object.

    Declaration
    public AddressableAssetGroupSchema AddSchema(AddressableAssetGroupSchema schema, bool postEvent = true)
    Parameters
    Type Name Description
    AddressableAssetGroupSchema schema

    The schema to add. A copy will be made and saved in a folder relative to the main Addressables settings asset.

    System.Boolean postEvent

    Determines if this method call will post an event to the internal addressables event system

    Returns
    Type Description
    AddressableAssetGroupSchema

    The created schema object.

    AddSchema<TSchema>(Boolean)

    Creates and adds a schema of a given type to this group.

    Declaration
    public TSchema AddSchema<TSchema>(bool postEvent = true)
        where TSchema : AddressableAssetGroupSchema
    Parameters
    Type Name Description
    System.Boolean postEvent

    Determines if this method call will post an event to the internal addressables event system

    Returns
    Type Description
    TSchema

    The created schema object.

    Type Parameters
    Name Description
    TSchema

    The schema type. This type must not already be added.

    CanBeSetAsDefault()

    Check if a group has the appropriate schemas and attributes that the Default Group requires.

    Declaration
    public bool CanBeSetAsDefault()
    Returns
    Type Description
    System.Boolean

    ClearSchemas(Boolean, Boolean)

    Removes all schemas and optionally deletes the assets associated with them.

    Declaration
    public void ClearSchemas(bool deleteAssets, bool postEvent = true)
    Parameters
    Type Name Description
    System.Boolean deleteAssets

    If true, the schema assets will also be deleted.

    System.Boolean postEvent

    Determines if this method call will post an event to the internal addressables event system

    Compare(AddressableAssetEntry, AddressableAssetEntry)

    Declaration
    public virtual int Compare(AddressableAssetEntry x, AddressableAssetEntry y)
    Parameters
    Type Name Description
    AddressableAssetEntry x
    AddressableAssetEntry y
    Returns
    Type Description
    System.Int32

    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 virtual void GatherAllAssets(List<AddressableAssetEntry> results, bool includeSelf, bool recurseAll, bool includeSubObjects, Func<AddressableAssetEntry, bool> entryFilter = null)
    Parameters
    Type Name Description
    System.Collections.Generic.List<AddressableAssetEntry> results

    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

    GetAssetEntry(String)

    Get an entry via the asset guid.

    Declaration
    public virtual AddressableAssetEntry GetAssetEntry(string guid)
    Parameters
    Type Name Description
    System.String guid

    The asset guid.

    Returns
    Type Description
    AddressableAssetEntry

    GetSchema(Type)

    Gets an added schema of the specified type.

    Declaration
    public AddressableAssetGroupSchema GetSchema(Type type)
    Parameters
    Type Name Description
    System.Type type

    The schema type.

    Returns
    Type Description
    AddressableAssetGroupSchema

    The schema if found, otherwise null.

    GetSchema<TSchema>()

    Gets an added schema of the specified type.

    Declaration
    public TSchema GetSchema<TSchema>()
        where TSchema : AddressableAssetGroupSchema
    Returns
    Type Description
    TSchema

    The schema if found, otherwise null.

    Type Parameters
    Name Description
    TSchema

    The schema type.

    HasSchema(Type)

    Checks if the group contains a schema of a given type.

    Declaration
    public bool HasSchema(Type type)
    Parameters
    Type Name Description
    System.Type type

    The schema type.

    Returns
    Type Description
    System.Boolean

    True if the schema type or subclass has been added to this group.

    HasSchema<TSchema>()

    Checks if the group contains a schema of a given type.

    Declaration
    public bool HasSchema<TSchema>()
    Returns
    Type Description
    System.Boolean

    True if the schema type or subclass has been added to this group.

    Type Parameters
    Name Description
    TSchema

    The schema type.

    IsDefaultGroup()

    Check to see if a group is the Default Group.

    Declaration
    public bool IsDefaultGroup()
    Returns
    Type Description
    System.Boolean

    OnAfterDeserialize()

    Converts data from serializable format.

    Declaration
    public void OnAfterDeserialize()

    OnBeforeSerialize()

    Converts data to serializable format.

    Declaration
    public void OnBeforeSerialize()

    RemoveAssetEntry(AddressableAssetEntry, Boolean)

    Remove an entry.

    Declaration
    public void RemoveAssetEntry(AddressableAssetEntry entry, bool postEvent = true)
    Parameters
    Type Name Description
    AddressableAssetEntry entry

    The entry to remove.

    System.Boolean postEvent

    If true, post the event to callbacks.

    RemoveSchema(Type, Boolean)

    Remove a given schema from this group.

    Declaration
    public bool RemoveSchema(Type type, bool postEvent = true)
    Parameters
    Type Name Description
    System.Type type

    The schema type.

    System.Boolean postEvent

    Determines if this method call will post an event to the internal addressables event system

    Returns
    Type Description
    System.Boolean

    True if the schema was found and removed, false otherwise.

    RemoveSchema<TSchema>(Boolean)

    Remove a given schema from this group.

    Declaration
    public bool RemoveSchema<TSchema>(bool postEvent = true)
    Parameters
    Type Name Description
    System.Boolean postEvent

    Determines if this method call will post an event to the internal addressables event system

    Returns
    Type Description
    System.Boolean

    True if the schema was found and removed, false otherwise.

    Type Parameters
    Name Description
    TSchema

    The schema type.

    SetDirty(AddressableAssetSettings.ModificationEvent, Object, Boolean, Boolean)

    Marks the object as modified.

    Declaration
    public void SetDirty(AddressableAssetSettings.ModificationEvent modificationEvent, object eventData, bool postEvent, bool groupModified = false)
    Parameters
    Type Name Description
    AddressableAssetSettings.ModificationEvent modificationEvent

    The event type that is changed.

    System.Object eventData

    The object data that corresponds to the event.

    System.Boolean postEvent

    If true, the event is propagated to callbacks.

    System.Boolean groupModified

    If true, the group asset will be marked as dirty.

    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