feat: establish mech extraction prototype with bilingual UI
Track Unity source, scenes, editable assets, licenses, tools and QA evidence. Exclude generated caches, Windows builds and raw runtime logs.
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
using UnityEngine;
|
||||
|
||||
namespace Ironspore
|
||||
{
|
||||
[RequireComponent(typeof(TextMesh))]
|
||||
public sealed class LocalizedWorldLabel : MonoBehaviour
|
||||
{
|
||||
string key;
|
||||
TextMesh label;
|
||||
|
||||
public void Initialize(string textKey)
|
||||
{
|
||||
key = textKey;
|
||||
label = GetComponent<TextMesh>();
|
||||
if (GameLocalization.Catalog && GameLocalization.Catalog.worldFont)
|
||||
{
|
||||
label.font = GameLocalization.Catalog.worldFont;
|
||||
GetComponent<MeshRenderer>().sharedMaterial = label.font.material;
|
||||
}
|
||||
Refresh();
|
||||
}
|
||||
void OnEnable() => GameLocalization.Changed += Refresh;
|
||||
void OnDisable() => GameLocalization.Changed -= Refresh;
|
||||
void Refresh()
|
||||
{
|
||||
if (label && !string.IsNullOrEmpty(key))
|
||||
label.text = GameLocalization.Text(key);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user