Class LocalizedTableCollection | Localization | 0.7.1-preview
docs.unity3d.com
    Show / Hide Table of Contents

    Class LocalizedTableCollection

    Editor interface to a collection of tables which all share the same SharedTableData.

    Inheritance
    Object
    LocalizedTableCollection
    AssetTableCollection
    StringTableCollection
    Namespace: UnityEditor.Localization
    Syntax
    public abstract class LocalizedTableCollection : ScriptableObject, ISerializationCallbackReceiver

    Properties

    DefaultTableGroupName

    The Addressables group that the tables will be added to for this collection.

    Declaration
    public abstract string DefaultTableGroupName { get; }
    Property Value
    Type Description
    String

    Extensions

    Extensions attached to the collection. Extensions can be used for attaching additional data or functionality to a collection.

    Declaration
    public ReadOnlyCollection<CollectionExtension> Extensions { get; }
    Property Value
    Type Description
    ReadOnlyCollection<CollectionExtension>

    RequiredExtensionAttribute

    Declaration
    protected abstract Type RequiredExtensionAttribute { get; }
    Property Value
    Type Description
    Type

    SharedData

    The SharedTableData that is used by all tables in this collection.

    Declaration
    public virtual SharedTableData SharedData { get; }
    Property Value
    Type Description
    SharedTableData

    TableCollectionName

    The name of this collection of Tables.

    Declaration
    public string TableCollectionName { get; set; }
    Property Value
    Type Description
    String

    TableCollectionNameReference

    Reference that can be used to refer to this table collection.

    Declaration
    public TableReference TableCollectionNameReference { get; }
    Property Value
    Type Description
    TableReference

    Tables

    All tables that are part of this collection. Tables are stored as LazyLoadReferences so that they are only loaded when required and not when the collection is loaded.

    Declaration
    public ReadOnlyCollection<LazyLoadReference<LocalizedTable>> Tables { get; }
    Property Value
    Type Description
    ReadOnlyCollection<LazyLoadReference<LocalizedTable>>

    TableType

    Declaration
    protected abstract Type TableType { get; }
    Property Value
    Type Description
    Type

    Methods

    AddExtension(CollectionExtension)

    Attaches the provided extension to the collection.

    Declaration
    public void AddExtension(CollectionExtension extension)
    Parameters
    Type Name Description
    CollectionExtension extension

    The extension to add to the collection.

    Exceptions
    Type Condition
    ArgumentException

    Thrown if the extension does not have correct attribute.

    AddNewTable(LocaleIdentifier)

    Creates a table in the collection.

    Declaration
    public virtual LocalizedTable AddNewTable(LocaleIdentifier localeIdentifier)
    Parameters
    Type Name Description
    LocaleIdentifier localeIdentifier
    Returns
    Type Description
    LocalizedTable

    AddNewTable(LocaleIdentifier, String)

    Creates a table in the collection.

    Declaration
    public virtual LocalizedTable AddNewTable(LocaleIdentifier localeIdentifier, string path)
    Parameters
    Type Name Description
    LocaleIdentifier localeIdentifier
    String path
    Returns
    Type Description
    LocalizedTable

    AddSharedTableDataToAddressables()

    Adds SharedData to Addressables.

    Declaration
    protected virtual void AddSharedTableDataToAddressables()

    AddTable(LocalizedTable, Boolean)

    Adds the table to the collection and updates Addressable assets. The table will not be added if it is not using the same SharedTableData as the collection.

    Declaration
    public virtual void AddTable(LocalizedTable table, bool postEvent = true)
    Parameters
    Type Name Description
    LocalizedTable table

    The table to add.

    Boolean postEvent

    AddTableToAddressables(LocalizedTable, Boolean)

    Add the table to the Addressable assets system.

    Declaration
    protected virtual void AddTableToAddressables(LocalizedTable table, bool createUndo)
    Parameters
    Type Name Description
    LocalizedTable table

    The table to add.

    Boolean createUndo

    Should an Undo operation be recorded?

    CanAddTable(LocalizedTable)

    Can this table be added to the collection? Checks if the table is already in the collection or if a table with the same LocaleIdentifier is in the collection.

    Declaration
    protected virtual bool CanAddTable(LocalizedTable table)
    Parameters
    Type Name Description
    LocalizedTable table

    The table to add.

    Returns
    Type Description
    Boolean

    ContainsTable(LocaleIdentifier)

    Checks if a table with the same LocaleIdentifier exists in the collection.

    Declaration
    public bool ContainsTable(LocaleIdentifier localeIdentifier)
    Parameters
    Type Name Description
    LocaleIdentifier localeIdentifier

    The Id to match against.

    Returns
    Type Description
    Boolean

    ContainsTable(LocalizedTable)

    Checks if a table with the same instance Id exists in the collection. This check should be fast as a table does not need to be loaded to have its instance Id compared.

    Declaration
    public bool ContainsTable(LocalizedTable table)
    Parameters
    Type Name Description
    LocalizedTable table

    The table to look for.

    Returns
    Type Description
    Boolean

    GetTable(LocaleIdentifier)

    Returns the table with the matching LocaleIdentifier.

    Declaration
    public LocalizedTable GetTable(LocaleIdentifier localeIdentifier)
    Parameters
    Type Name Description
    LocaleIdentifier localeIdentifier

    The locale identifier that the table must have.

    Returns
    Type Description
    LocalizedTable

    The table with the matching LocaleIdentifier or null if one does not exist in the collection.

    ImportCollectionIntoProject()

    Called when the asset is created or imported into a project(via OnPostprocessAllAssets).

    Declaration
    protected virtual void ImportCollectionIntoProject()

    IsPreloadTableFlagSet()

    Are the tables in the collection set to preload?

    Declaration
    public virtual bool IsPreloadTableFlagSet()
    Returns
    Type Description
    Boolean

    True if all tables are set to preload else false.

    OnAfterDeserialize()

    Declaration
    public void OnAfterDeserialize()

    OnBeforeSerialize()

    Declaration
    public void OnBeforeSerialize()

    RefreshAddressables(Boolean)

    Forces Addressables data to be updated for this collection. This will ensure that SharedData and Tables are both part of Addressables and correctly labeled.

    Declaration
    public void RefreshAddressables(bool createUndo = false)
    Parameters
    Type Name Description
    Boolean createUndo

    RemoveCollectionFromProject()

    Called to remove the asset from a project, such as when it is about to be deleted.

    Declaration
    protected virtual void RemoveCollectionFromProject()

    RemoveExtension(CollectionExtension)

    Removes the extension from Extensions.

    Declaration
    public void RemoveExtension(CollectionExtension extension)
    Parameters
    Type Name Description
    CollectionExtension extension

    RemoveTable(LocalizedTable, Boolean)

    Removes the table from the collection and updates Addressables assets.

    Declaration
    public virtual void RemoveTable(LocalizedTable table, bool postEvent = true)
    Parameters
    Type Name Description
    LocalizedTable table
    Boolean postEvent

    RemoveTableFromAddressables(LocalizedTable, Boolean)

    Remove the table from the Addressables system.

    Declaration
    protected virtual void RemoveTableFromAddressables(LocalizedTable table, bool createUndo)
    Parameters
    Type Name Description
    LocalizedTable table

    The table to remove.

    Boolean createUndo

    Should an Undo operation be recorded?

    SetPreloadTableFlag(Boolean, Boolean)

    Sets the preload flag for all tables in this collection.

    Declaration
    public virtual void SetPreloadTableFlag(bool preload, bool createUndo = false)
    Parameters
    Type Name Description
    Boolean preload

    Should the tables be preloaded? True for preloading or false to load on demand.

    Boolean createUndo

    Create an undo point?

    SetTableCollectionName(String, Boolean)

    Changes the table collection name. This will change TableCollectionName and update the Addressables data for all tables within the collection.

    Declaration
    public void SetTableCollectionName(string name, bool createUndo = false)
    Parameters
    Type Name Description
    String name
    Boolean createUndo

    ToString()

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