docs.unity3d.com
    Show / Hide Table of Contents

    Class AssetTableCollection

    Contains information on all the tables associated with a table collection name and type.

    Inheritance
    Object
    Object
    ScriptableObject
    LocalizationTableCollection
    AssetTableCollection
    Inherited Members
    LocalizationTableCollection.Tables
    LocalizationTableCollection.Extensions
    LocalizationTableCollection.TableCollectionName
    LocalizationTableCollection.TableCollectionNameReference
    LocalizationTableCollection.SharedData
    LocalizationTableCollection.Group
    LocalizationTableCollection.SetTableCollectionName(String, Boolean)
    LocalizationTableCollection.SetPreloadTableFlag(Boolean, Boolean)
    LocalizationTableCollection.IsPreloadTableFlagSet()
    LocalizationTableCollection.AddTable(LocalizationTable, Boolean, Boolean)
    LocalizationTableCollection.AddNewTable(LocaleIdentifier)
    LocalizationTableCollection.AddNewTable(LocaleIdentifier, String)
    LocalizationTableCollection.RemoveTable(LocalizationTable, Boolean, Boolean)
    LocalizationTableCollection.GetTable(LocaleIdentifier)
    LocalizationTableCollection.RefreshAddressables(Boolean)
    LocalizationTableCollection.ContainsTable(LocalizationTable)
    LocalizationTableCollection.ContainsTable(LocaleIdentifier)
    LocalizationTableCollection.AddExtension(CollectionExtension)
    LocalizationTableCollection.RemoveExtension(CollectionExtension)
    LocalizationTableCollection.GetRowEnumerator<TTable, TEntry>(IEnumerable<TTable>)
    LocalizationTableCollection.GetRowEnumeratorUnsorted<TTable, TEntry>(IList<TTable>)
    LocalizationTableCollection.AddSharedTableDataToAddressables()
    LocalizationTableCollection.AddTableToAddressables(LocalizationTable, Boolean)
    LocalizationTableCollection.ImportCollectionIntoProject()
    LocalizationTableCollection.RemoveCollectionFromProject()
    ScriptableObject.SetDirty()
    ScriptableObject.CreateInstance(String)
    ScriptableObject.CreateInstance(Type)
    ScriptableObject.CreateInstance<T>()
    Object.GetInstanceID()
    Object.GetHashCode()
    Object.Equals(Object)
    Object.Instantiate(Object, Vector3, Quaternion)
    Object.Instantiate(Object, Vector3, Quaternion, Transform)
    Object.Instantiate(Object)
    Object.Instantiate(Object, Transform)
    Object.Instantiate(Object, Transform, Boolean)
    Object.Instantiate<T>(T)
    Object.Instantiate<T>(T, Vector3, Quaternion)
    Object.Instantiate<T>(T, Vector3, Quaternion, Transform)
    Object.Instantiate<T>(T, Transform)
    Object.Instantiate<T>(T, Transform, Boolean)
    Object.Destroy(Object, Single)
    Object.Destroy(Object)
    Object.DestroyImmediate(Object, Boolean)
    Object.DestroyImmediate(Object)
    Object.FindObjectsOfType(Type)
    Object.DontDestroyOnLoad(Object)
    Object.DestroyObject(Object, Single)
    Object.DestroyObject(Object)
    Object.FindSceneObjectsOfType(Type)
    Object.FindObjectsOfTypeIncludingAssets(Type)
    Object.FindObjectsOfType<T>()
    Object.FindObjectOfType<T>()
    Object.FindObjectsOfTypeAll(Type)
    Object.FindObjectOfType(Type)
    Object.name
    Object.hideFlags
    Namespace: UnityEditor.Localization
    Syntax
    public class AssetTableCollection : LocalizationTableCollection, ISerializationCallbackReceiver

    Properties

    AssetTables

    A helper property which is the contents of Tables loaded and cast to AssetTable.

    Declaration
    public virtual ReadOnlyCollection<AssetTable> AssetTables { get; }
    Property Value
    Type Description
    ReadOnlyCollection<AssetTable>

    DefaultGroupName

    The default value to use for Group.

    Declaration
    protected override string DefaultGroupName { get; }
    Property Value
    Type Description
    String
    Overrides
    LocalizationTableCollection.DefaultGroupName

    RequiredExtensionAttribute

    The required attribute for an extension to be added to this collection through the Editor.

    Declaration
    protected override Type RequiredExtensionAttribute { get; }
    Property Value
    Type Description
    Type
    Overrides
    LocalizationTableCollection.RequiredExtensionAttribute

    TableType

    The type of table stored in the collection.

    Declaration
    protected override Type TableType { get; }
    Property Value
    Type Description
    Type
    Overrides
    LocalizationTableCollection.TableType

    Methods

    AddAssetToTable(LocaleIdentifier, TableEntryReference, Object, Boolean)

    Add a localized asset to the asset table that matches the LocaleIdentifier. This function ensures the localization system adds the asset to the Addressables system and sets the asset up for use.

    Declaration
    public void AddAssetToTable(LocaleIdentifier localeIdentifier, TableEntryReference entryReference, Object asset, bool createUndo = false)
    Parameters
    Type Name Description
    LocaleIdentifier localeIdentifier

    The table to add the asset to, if a table with the id does not exist a new one will be created.

    TableEntryReference entryReference

    The table entry Key or Key Id.

    Object asset

    The asset to add.

    Boolean createUndo

    Should an undo operation be created?

    AddAssetToTable(AssetTable, TableEntryReference, Object, Boolean)

    Add a localized asset to the asset table. This function will ensure the localization system adds the asset to the Addressables system and sets the asset up for use.

    Declaration
    public virtual void AddAssetToTable(AssetTable table, TableEntryReference entryReference, Object asset, bool createUndo = false)
    Parameters
    Type Name Description
    AssetTable table

    The table to add the asset to, must be part of the collection.

    TableEntryReference entryReference

    The table entry Key or Key Id.

    Object asset

    The asset to add.

    Boolean createUndo

    Should an undo operation be created?

    ClearAllEntries()

    Removes all the entries from SharedTableData and all Tables that are part of this collection.

    Declaration
    public override void ClearAllEntries()
    Overrides
    LocalizationTableCollection.ClearAllEntries()

    GetEntryAssetType(TableEntryReference)

    Returns the expected type for the entry. When an asset is first added to an entry, the type is recorded so that the Editor can ensure all subsequent assets that are added are compatible.

    Declaration
    public Type GetEntryAssetType(TableEntryReference tableEntry)
    Parameters
    Type Name Description
    TableEntryReference tableEntry

    The entry to return the asset type for.

    Returns
    Type Description
    Type

    The expected asset type or typeof(Object) if unknown.

    GetRowEnumerator()

    Returns an enumerator that can be used to step through each key and its localized values, such as in a foreach loop. Internally SharedTableData and AssetTable's are separate assets with their own internal list of values. This means that when iterating through each key a lookup must be made in each table in order to retrieve the localized value, this can become slow when dealing with a large number of tables and entries. GetRowEnumerator improves this process by first sorting the multiple internal lists and then stepping through each conceptual row at a time. It handles missing keys and table entries and provides a more efficient and faster way to iterate through the tables.

    Declaration
    public IEnumerable<LocalizationTableCollection.Row<AssetTableEntry>> GetRowEnumerator()
    Returns
    Type Description
    IEnumerable<LocalizationTableCollection.Row<AssetTableEntry>>

    RemoveAssetFromTable(AssetTable, TableEntryReference, Boolean)

    Remove the asset mapping from the table entry and also cleans up the Addressables if necessary.

    Declaration
    public void RemoveAssetFromTable(AssetTable table, TableEntryReference entryReference, bool createUndo = false)
    Parameters
    Type Name Description
    AssetTable table
    TableEntryReference entryReference
    Boolean createUndo

    RemoveEntry(TableEntryReference)

    Removes the entry from the SharedTableData and all tables that are part of this collection.

    Declaration
    public override void RemoveEntry(TableEntryReference entryReference)
    Parameters
    Type Name Description
    TableEntryReference entryReference
    Overrides
    LocalizationTableCollection.RemoveEntry(TableEntryReference)

    RemoveTableFromAddressables(LocalizationTable, Boolean)

    Remove the table from the Addressables system.

    Declaration
    protected override void RemoveTableFromAddressables(LocalizationTable table, bool createUndo)
    Parameters
    Type Name Description
    LocalizationTable table

    The table to remove.

    Boolean createUndo

    Should an Undo operation be recorded?

    Overrides
    LocalizationTableCollection.RemoveTableFromAddressables(LocalizationTable, Boolean)

    SetEntryAssetType(TableEntryReference, Type)

    The type of asset that is expected by this entry. By default this is determined by the first asset that is added in the Editor however this can be used to override it so it always expects this asset type instead of reverting back to Object when the last asset is removed.

    Declaration
    public void SetEntryAssetType(TableEntryReference tableEntry, Type assetType)
    Parameters
    Type Name Description
    TableEntryReference tableEntry

    The entry to set the asset type for.

    Type assetType

    The asset type to expect for this entry. To reset the override and allow the Editor to control the type pass null or typeof(Object).

    UpdateAssetGroup(AddressableAssetSettings, AddressableAssetEntry, Boolean)

    Updates the group the asset should belong to. Assets will be stored in groups for the Locale they are used by unless they are used by more than 1 Locale, then they will be moved to the shared group.

    Declaration
    protected virtual void UpdateAssetGroup(AddressableAssetSettings settings, AddressableAssetEntry assetEntry, bool createUndo)
    Parameters
    Type Name Description
    AddressableAssetSettings settings
    AddressableAssetEntry assetEntry
    Boolean createUndo

    Used to indicate if an Undo operation should be created.

    In This Article
    • Properties
      • AssetTables
      • DefaultGroupName
      • RequiredExtensionAttribute
      • TableType
    • Methods
      • AddAssetToTable(LocaleIdentifier, TableEntryReference, Object, Boolean)
      • AddAssetToTable(AssetTable, TableEntryReference, Object, Boolean)
      • ClearAllEntries()
      • GetEntryAssetType(TableEntryReference)
      • GetRowEnumerator()
      • RemoveAssetFromTable(AssetTable, TableEntryReference, Boolean)
      • RemoveEntry(TableEntryReference)
      • RemoveTableFromAddressables(LocalizationTable, Boolean)
      • SetEntryAssetType(TableEntryReference, Type)
      • UpdateAssetGroup(AddressableAssetSettings, AddressableAssetEntry, 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