Class SharedTableData
The SharedTableData holds data that is accessible across all tables. It is responsible for the localization keys and associating the keys to unique ids. Each collection of tables will reference a single SharedTableData asset.
Implements
Inherited Members
Namespace: UnityEngine.Localization.Tables
Assembly: Unity.Localization.dll
Syntax
public class SharedTableData : ScriptableObject, ISerializationCallbackReceiver
Fields
Name | Description |
---|---|
EmptyId | Represents an empty or null Key Id. |
Properties
Name | Description |
---|---|
Entries | All entries. |
KeyGenerator | The Key Generator to use when adding new entries. By default this will use DistributedUIDGenerator. |
Metadata | Metadata that is shared between all tables. |
TableCollectionName | The name of this table collection. All LocalizationTable that use this SharedTableData will have this name. |
TableCollectionNameGuid | A unique Id that will never change. Comes from the SharedTableData asset Guid. Provides a way to reference a table that will not be broken if the table collection name was to be changed. |
Methods
Name | Description |
---|---|
AddKey(string) | Adds a new key to this SharedTableData with a default name. If the name already exists then a unique version is generated based on the provided name. |
AddKey(string, long) | Adds a new key to this SharedTableData if one does not already exists with the same id. |
Clear() | Clear all entries in this table. |
Contains(long) | Is the Id value used by any entries in this SharedTableData? |
Contains(string) | Is the key value used by any entries in this SharedTableData? |
FindSimilarKey(string, out int) | Returns the SharedTableData.SharedTableEntry that is the most similar to the text. Uses the Levenshtein distance method. |
GetEntry(long) | Returns the Entry for the key id, this contains all data for the key. |
GetEntry(string) | Returns the Entry for the key, this contains all data for the key. |
GetEntryFromReference(TableEntryReference) | Returns the Entry for the key id, this contains all data for the key. |
GetId(string) | Get the unique Id for the key name from the shared table data. |
GetId(string, bool) | Get the unique Id for the key name, if one does not exist then a new entry is added. |
GetKey(long) | Get the key associated with the id. |
RemapId(long, long) | Attempts to change the Id of an entry. |
RemoveKey(long) | Attempts to remove the key with provided id. |
RemoveKey(string) | Attempts to remove the key from this SharedTableData. |
RenameKey(long, string) | Rename the key value for the provided id if it exists. |
RenameKey(string, string) | Rename the key value if it exists. |