Localized Object
Acts as a bridge between objects and managers, applies table output to the object.
Workflow
With this component, you can get the output of localization key within the selected table. Depending on the selected object type, the output value will be applied to the component (e.g. TextMesh Pro). As long as ‘On Enable’ is selected as the preferred update mode, the object will be updated when activated.
You can use the search bar to easily assign a localization key. You can click on a search result to automatically complete the ‘Localization Key’ field. As long as the ‘Show Output’ option is enabled (checkbox next to the text field), you will see the output in all available languages.
Tip: You can use the ‘Edit Table’ button to quickly view and modify the selected table.
How Do I Localize My Own Objects?
You can basically add this component to localize custom objects. For instance, you can follow these steps to localize a TMP object:
- Select the TMP object
- Hit ‘Add Component’
- Navigate to Reach UI > Localization > Localized Object
- or just search for ‘Localized Object’
- Set ‘TextMesh Pro’ as the preferred object type
- Assign the TMP component to the ‘Text Object’ field
- Assign a valid localization key
Scripting
using UnityEngine;
using Michsky.UI.Hex; // Namespace
public class SampleClass : MonoBehaviour
{
[SerializeField] private LocalizedObject locObject;
void Start()
{
// Updates the component to get the latest data
locObject.UpdateItem();
// Reinitialize the component to apply core changes
locObject.ReInitializeItem();
// Get key output within the selected table
locObject.GetKeyOutput("Localization Key");
// Get key output within the specified table
// No reference required for this call as it's static
LocalizedObject.GetKeyOutput("Table ID", "Localization Key");
// Example usage of GetKeyOutput
string yourString = locObject.GetKeyOutput("Localization Key");
}
}
How can we help?
A premium WordPress theme with an integrated Knowledge Base,
providing 24/7 community-based support.