using System.Collections; using System.Collections.Generic; using UnityEngine; public class ButtonSwitchLanguages : ButtonOnClick { private void Awake() { Localization.SelectedLanguage = (LocalizationLanguage)PlayerPrefs.GetInt("lang", 0); } public override void OnClick() { Localization.SelectedLanguage = Localization.SelectedLanguage == LocalizationLanguage.English ? LocalizationLanguage.Japanese : LocalizationLanguage.English; PlayerPrefs.SetInt("lang", (int)Localization.SelectedLanguage); Localization.RebuildKeyDictionary(); var injector = FindObjectsOfType(); foreach(var i in injector){ i.UpdateText(); } } }