Class DetailedLocalizationTable<TEntry>
Inherited Members
Namespace: UnityEngine.Localization.Tables
Syntax
public abstract class DetailedLocalizationTable<TEntry> : LocalizationTable, IMetadataCollection, IComparable<LocalizationTable>, IDictionary<long, TEntry>, ICollection<KeyValuePair<long, TEntry>>, IEnumerable<KeyValuePair<long, TEntry>>, IEnumerable, ISerializationCallbackReceiver where TEntry : TableEntry
Type Parameters
Name | Description |
---|---|
TEntry |
Properties
Count
The number of entries in this Table.
Declaration
public int Count { get; }
Property Value
Type | Description |
---|---|
Int32 |
IsReadOnly
Will always be false. Implemented because it is required by the System.Collections.IList interface.
Declaration
public bool IsReadOnly { get; }
Property Value
Type | Description |
---|---|
Boolean |
Item[Int64]
Get/Set a value using the specified key.
Declaration
public TEntry this[long key] { get; set; }
Parameters
Type | Name | Description |
---|---|---|
Int64 | key |
Property Value
Type | Description |
---|---|
TEntry |
Item[String]
Get/Set a value using the specified key name.
Declaration
public TEntry this[string keyName] { get; set; }
Parameters
Type | Name | Description |
---|---|---|
String | keyName |
Property Value
Type | Description |
---|---|
TEntry |
Values
All values in this table.
Declaration
public ICollection<TEntry> Values { get; }
Property Value
Type | Description |
---|---|
ICollection<TEntry> |
Methods
Add(KeyValuePair<Int64, TEntry>)
Adds the item value with the specified keyId.
Declaration
public void Add(KeyValuePair<long, TEntry> item)
Parameters
Type | Name | Description |
---|---|---|
KeyValuePair<Int64, TEntry> | item |
Add(Int64, TEntry)
Adds the entry with the specified keyId.
Declaration
public void Add(long keyId, TEntry value)
Parameters
Type | Name | Description |
---|---|---|
Int64 | keyId | |
TEntry | value |
AddEntry(Int64, String)
Add or update an entry in the table.
Declaration
public virtual TEntry AddEntry(long keyId, string localized)
Parameters
Type | Name | Description |
---|---|---|
Int64 | keyId | The unique key id. |
String | localized | The localized item, a string for StringTable or asset guid for AssetTable. |
Returns
Type | Description |
---|---|
TEntry |
AddEntry(String, String)
Add or update an entry in the table.
Declaration
public TEntry AddEntry(string key, string localized)
Parameters
Type | Name | Description |
---|---|---|
String | key | The name of the key. |
String | localized | The localized item, a string for StringTable or asset guid for AssetTable. |
Returns
Type | Description |
---|---|
TEntry |
AddEntryFromReference(TableEntryReference, String)
Add or update an entry in the table.
Declaration
public TEntry AddEntryFromReference(TableEntryReference entryReference, string localized)
Parameters
Type | Name | Description |
---|---|---|
TableEntryReference | entryReference | The TableEntryReference containing a valid Key or Key Id. |
String | localized | The localized item, a string for StringTable or asset guid for AssetTable |
Returns
Type | Description |
---|---|
TEntry |
CheckForMissingSharedTableDataEntries(MissingEntryAction)
Tables do not store the full information for an entry, instead they store just the Id of that entry which can then be referenced in
Declaration
public IList<TEntry> CheckForMissingSharedTableDataEntries(MissingEntryAction action = MissingEntryAction.Nothing)
Parameters
Type | Name | Description |
---|---|---|
MissingEntryAction | action | The action to take on the found missing entries. |
Returns
Type | Description |
---|---|
IList<TEntry> | The identified missing entries. |
Clear()
Clear all entries in this table.
Declaration
public void Clear()
Contains(KeyValuePair<Int64, TEntry>)
Returns true if the table contains the item.
Declaration
public bool Contains(KeyValuePair<long, TEntry> item)
Parameters
Type | Name | Description |
---|---|---|
KeyValuePair<Int64, TEntry> | item |
Returns
Type | Description |
---|---|
Boolean |
ContainsKey(Int64)
Returns true if the table contains an entry with the keyId.
Declaration
public bool ContainsKey(long keyId)
Parameters
Type | Name | Description |
---|---|---|
Int64 | keyId |
Returns
Type | Description |
---|---|
Boolean |
ContainsValue(String)
Returns true if the table contains an entry with the same value.
Declaration
public bool ContainsValue(string localized)
Parameters
Type | Name | Description |
---|---|---|
String | localized | The value to check for in all table entries. |
Returns
Type | Description |
---|---|
Boolean | True if a match was found else false. |
CopyTo(KeyValuePair<Int64, TEntry>[], Int32)
Copies the contents of the table into an array starting at the arrayIndex.
Declaration
public void CopyTo(KeyValuePair<long, TEntry>[] array, int arrayIndex)
Parameters
Type | Name | Description |
---|---|---|
KeyValuePair<Int64, TEntry>[] | array | |
Int32 | arrayIndex |
CreateEmpty(TableEntryReference)
Create an empty entry in the table at the specified entry.
Declaration
public override void CreateEmpty(TableEntryReference entryReference)
Parameters
Type | Name | Description |
---|---|---|
TableEntryReference | entryReference |
Overrides
CreateTableEntry()
Returns a new instance of TEntry.
Declaration
public abstract TEntry CreateTableEntry()
Returns
Type | Description |
---|---|
TEntry |
GetEntry(Int64)
Returns the entry for the key id or null if one does not exist.
Declaration
public virtual TEntry GetEntry(long keyId)
Parameters
Type | Name | Description |
---|---|---|
Int64 | keyId |
Returns
Type | Description |
---|---|
TEntry |
GetEntry(String)
Returns the entry for the key or null if one does not exist.
Declaration
public TEntry GetEntry(string key)
Parameters
Type | Name | Description |
---|---|---|
String | key |
Returns
Type | Description |
---|---|
TEntry |
GetEntryFromReference(TableEntryReference)
Returns the entry reference or null if one does not exist.
Declaration
public TEntry GetEntryFromReference(TableEntryReference entryReference)
Parameters
Type | Name | Description |
---|---|---|
TableEntryReference | entryReference |
Returns
Type | Description |
---|---|
TEntry |
GetEnumerator()
Return an enumerator for the entries in this table.
Declaration
public IEnumerator<KeyValuePair<long, TEntry>> GetEnumerator()
Returns
Type | Description |
---|---|
IEnumerator<KeyValuePair<Int64, TEntry>> |
OnAfterDeserialize()
Converts the serialized data into UnityEngine.Localization.Tables.DetailedLocalizationTable`1.m_TableEntries.
Declaration
public void OnAfterDeserialize()
Implements
OnBeforeSerialize()
Does nothing but required for OnAfterDeserialize().
Declaration
public void OnBeforeSerialize()
Implements
Remove(KeyValuePair<Int64, TEntry>)
Remove the item from the table if it exists.
Declaration
public bool Remove(KeyValuePair<long, TEntry> item)
Parameters
Type | Name | Description |
---|---|---|
KeyValuePair<Int64, TEntry> | item |
Returns
Type | Description |
---|---|
Boolean |
Remove(Int64)
Remove the entry with the keyId.
Declaration
public bool Remove(long keyId)
Parameters
Type | Name | Description |
---|---|---|
Int64 | keyId |
Returns
Type | Description |
---|---|
Boolean |
RemoveEntry(Int64)
Remove an entry from the table if it exists.
Declaration
public virtual bool RemoveEntry(long keyId)
Parameters
Type | Name | Description |
---|---|---|
Int64 | keyId | The key id to remove. |
Returns
Type | Description |
---|---|
Boolean | True if the entry was found and removed. |
RemoveEntry(String)
Remove an entry from the table if it exists.
Declaration
public bool RemoveEntry(string key)
Parameters
Type | Name | Description |
---|---|---|
String | key | The name of the key. |
Returns
Type | Description |
---|---|
Boolean | True if the entry was found and removed. |
ToString()
Creates a string representation of the table as "{TableCollectionName}({LocaleIdentifier})".
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
String |
Overrides
TryGetValue(Int64, out TEntry)
Find the entry, if it exists in the table.
Declaration
public bool TryGetValue(long keyId, out TEntry value)
Parameters
Type | Name | Description |
---|---|---|
Int64 | keyId | |
TEntry | value |
Returns
Type | Description |
---|---|
Boolean | True if the entry was found. |