Esempio n. 1
0
    public static void ToggleLanguage_Static()
    {
        switch (TheApplicationLanguage)
        {
        case SystemLanguage.English:
            TheApplicationLanguage = SystemLanguage.Japanese;
            break;

        default:
            TheApplicationLanguage = SystemLanguage.English;
            break;
        }
        PlayerPrefs.SetString("Language", Japanese ? "Japanese" : "English");
        OnChangedLanguage?.Invoke();
    }
Esempio n. 2
0
 public static void Init()
 {
     IsAdditive             = false;
     TheApplicationLanguage = SystemLanguage.English;
     BgmVolume   = 0.25f;
     SfxVolume   = 0.8f;
     VoiceVolume = 1.0f;
     TheLanguage = "English";
     BgmVolume   = PlayerPrefs.GetFloat("MusicVolume", BgmVolume);
     PlayerPrefs.SetFloat("MusicVolume", BgmVolume);
     OnChangedBgmVolume?.Invoke();
     SfxVolume = PlayerPrefs.GetFloat("SfxVolume", SfxVolume);
     PlayerPrefs.SetFloat("SfxVolume", SfxVolume);
     OnChangedSfxVolume?.Invoke();
     VoiceVolume = PlayerPrefs.GetFloat("VoiceVolume", VoiceVolume);
     PlayerPrefs.SetFloat("VoiceVolume", VoiceVolume);
     OnChangedVoiceVolume?.Invoke();
     TheLanguage = PlayerPrefs.GetString("Language", TheLanguage);
     PlayerPrefs.SetString("Language", TheLanguage);
     TheApplicationLanguage = "Japanese" == TheLanguage ?
                              SystemLanguage.Japanese : SystemLanguage.English;
     OnChangedLanguage?.Invoke();
 }