docs.unity3d.com
    Show / Hide Table of Contents

    Class TableEntry

    Player version of a table entry that can contain additional data that is not serialized.

    Inheritance
    Object
    TableEntry
    AssetTableEntry
    StringTableEntry
    Namespace: UnityEngine.Localization.Tables
    Syntax
    public class TableEntry : IMetadataCollection

    Properties

    Key

    The Key or Name of this table entry that is stored in SharedEntry.

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

    KeyId

    Key Id for this table entry.

    Declaration
    public long KeyId { get; }
    Property Value
    Type Description
    Int64

    LocalizedValue

    Raw localized value.

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

    MetadataEntries

    The Metadata for this table entry.

    Declaration
    public IList<IMetadata> MetadataEntries { get; }
    Property Value
    Type Description
    IList<IMetadata>
    Implements
    IMetadataCollection.MetadataEntries

    SharedEntry

    The shared table entry contains information for all locales, this is taken from SharedTableData.

    Declaration
    public SharedTableData.SharedTableEntry SharedEntry { get; }
    Property Value
    Type Description
    SharedTableData.SharedTableEntry

    Table

    The table that this entry is part of.

    Declaration
    public LocalizationTable Table { get; }
    Property Value
    Type Description
    LocalizationTable

    Methods

    AddMetadata(IMetadata)

    Add an entry to MetadataEntries.

    Declaration
    public void AddMetadata(IMetadata md)
    Parameters
    Type Name Description
    IMetadata md
    Implements
    IMetadataCollection.AddMetadata(IMetadata)

    AddSharedMetadata(SharedTableCollectionMetadata)

    SharedTableCollectionMetadata is Metadata that can be applied to multiple table entries in a table collection. The Metadata is stored in the SharedTableData.

    Declaration
    public void AddSharedMetadata(SharedTableCollectionMetadata md)
    Parameters
    Type Name Description
    SharedTableCollectionMetadata md

    AddSharedMetadata(SharedTableEntryMetadata)

    SharedTableEntryMetadata is Metadata that can be shared across multiple entries in a single table. The instance reference will be stored in UnityEngine.Localization.Tables.LocalizationTable.TableData and MetadataEntries.

    Declaration
    public void AddSharedMetadata(SharedTableEntryMetadata md)
    Parameters
    Type Name Description
    SharedTableEntryMetadata md

    AddTagMetadata<TShared>()

    Tags are Metadata that can be shared across multiple table entries, they are often used to indicate an entry has a particular attribute or feature, e.g SmartFormat. Generally Tags do not contains data, for sharing data across multiple table entries see AddSharedMetadata(SharedTableEntryMetadata). A Tag reference will be stored in UnityEngine.Localization.Tables.LocalizationTable.TableData and MetadataEntries.

    Declaration
    public void AddTagMetadata<TShared>()
        where TShared : SharedTableEntryMetadata, new()
    Type Parameters
    Name Description
    TShared

    Contains(IMetadata)

    Checks if the Metadata is contained within MetadataEntries.

    Declaration
    public bool Contains(IMetadata md)
    Parameters
    Type Name Description
    IMetadata md
    Returns
    Type Description
    Boolean
    Implements
    IMetadataCollection.Contains(IMetadata)

    GetMetadata<TObject>()

    Returns the first Metadata item from MetadataEntries of type TObject.

    Declaration
    public TObject GetMetadata<TObject>()
        where TObject : IMetadata
    Returns
    Type Description
    TObject
    Type Parameters
    Name Description
    TObject
    Implements
    IMetadataCollection.GetMetadata<TObject>()

    GetMetadatas<TObject>()

    Returns all Metadata from MetadataEntries that is of type TObject.

    Declaration
    public IList<TObject> GetMetadatas<TObject>()
        where TObject : IMetadata
    Returns
    Type Description
    IList<TObject>
    Type Parameters
    Name Description
    TObject
    Implements
    IMetadataCollection.GetMetadatas<TObject>()

    GetMetadatas<TObject>(IList<TObject>)

    Populates the list with all Metadata from MetadataEntries that is of type TObject.

    Declaration
    public void GetMetadatas<TObject>(IList<TObject> foundItems)
        where TObject : IMetadata
    Parameters
    Type Name Description
    IList<TObject> foundItems
    Type Parameters
    Name Description
    TObject
    Implements
    IMetadataCollection.GetMetadatas<TObject>(IList<TObject>)

    HasTagMetadata<TShared>()

    Returns true if any tag metadata of type TShared contains this entry.

    Declaration
    public bool HasTagMetadata<TShared>()
        where TShared : SharedTableEntryMetadata
    Returns
    Type Description
    Boolean
    Type Parameters
    Name Description
    TShared

    RemoveMetadata(IMetadata)

    Remove an entry from MetadataEntries.

    Declaration
    public bool RemoveMetadata(IMetadata md)
    Parameters
    Type Name Description
    IMetadata md
    Returns
    Type Description
    Boolean
    Implements
    IMetadataCollection.RemoveMetadata(IMetadata)

    RemoveSharedMetadata(SharedTableCollectionMetadata)

    Removes the entry from the Shared Metadata and removes it from the SharedTableData if no other entries are using it.

    Declaration
    public void RemoveSharedMetadata(SharedTableCollectionMetadata md)
    Parameters
    Type Name Description
    SharedTableCollectionMetadata md

    RemoveSharedMetadata(SharedTableEntryMetadata)

    Removes the entry from the shared Metadata in the table and removes the shared Metadata if no other entries are using it.

    Declaration
    public void RemoveSharedMetadata(SharedTableEntryMetadata md)
    Parameters
    Type Name Description
    SharedTableEntryMetadata md

    RemoveTagMetadata<TShared>()

    Removes the Metadata tag from this entry and the table if it is no longer used by any other table entries.

    Declaration
    public void RemoveTagMetadata<TShared>()
        where TShared : SharedTableEntryMetadata
    Type Parameters
    Name Description
    TShared
    In This Article
    • Properties
      • Key
      • KeyId
      • LocalizedValue
      • MetadataEntries
      • SharedEntry
      • Table
    • Methods
      • AddMetadata(IMetadata)
      • AddSharedMetadata(SharedTableCollectionMetadata)
      • AddSharedMetadata(SharedTableEntryMetadata)
      • AddTagMetadata<TShared>()
      • Contains(IMetadata)
      • GetMetadata<TObject>()
      • GetMetadatas<TObject>()
      • GetMetadatas<TObject>(IList<TObject>)
      • HasTagMetadata<TShared>()
      • RemoveMetadata(IMetadata)
      • RemoveSharedMetadata(SharedTableCollectionMetadata)
      • RemoveSharedMetadata(SharedTableEntryMetadata)
      • RemoveTagMetadata<TShared>()
    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