blob: bb51e1b2eb40169be218a9fb8952f2e68c48b877 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
using System;
using UnityEngine;
[RequireComponent(typeof(TextRenderer))]
public class TextTranslator : MonoBehaviour, ITranslatedText
{
public StringNames TargetText;
public void ResetText()
{
base.GetComponent<TextRenderer>().Text = DestroyableSingleton<TranslationController>.Instance.GetString(this.TargetText, Array.Empty<object>());
}
public void Start()
{
DestroyableSingleton<TranslationController>.Instance.ActiveTexts.Add(this);
this.ResetText();
}
public void OnDestroy()
{
DestroyableSingleton<TranslationController>.Instance.ActiveTexts.Remove(this);
}
}
|