TableEntryReference
struct in
Unity.Localization
Suggest a change
Success!
Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.
Close
Submission failed
For some reason your suggested change could not be submitted. Please <a>try again</a> in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.
Close
Description
A serializable reference to a single table entry, identified either by its key text or by its stable key id.
using Unity.Localization;
using UnityEngine;
namespace Unity.Localization.Samples
{
public class TableEntryReferenceOverviewExample
{
public void Run(SharedTableData sharedData)
{
TableEntryReference byKey = "Menu/Start"; // implicit conversion from string
TableEntryReference byId = 12345L; // implicit conversion from long
long id = byKey.ResolveKeyId(sharedData);
Debug.Log($"{id} {byId.KeyId}");
}
}
}
Properties
| Property |
Description |
| IsEmpty |
Whether this reference points at nothing.
|
| Key |
The key text of the referenced entry, or null when the reference is empty or id-based.
|
| KeyId |
The stable key id of the referenced entry, or 0 when the reference is empty or name-based.
|
| ReferenceType |
How this reference identifies its entry.
|
Public Methods
| Method |
Description |
| Equals |
Checks whether this reference identifies the same entry as another.
|
| GetHashCode |
Computes a hash code for this reference.
|
| ResolveKeyId |
Resolves this reference to a numeric key id using the given shared table data.
|
| ResolveKeyName |
Resolves this reference to a key name using the given shared table data.
|
| ToString |
Returns a readable string describing this reference.
|