23 lines
698 B
C#
23 lines
698 B
C#
|
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<LocalizationButtonInjector>();
|
|||
|
foreach(var i in injector){
|
|||
|
i.UpdateText();
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
}
|