1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768 |
- using ICTS.Localization;
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- public class LanguigeManager : MonoBehaviour
- {
- public ScreenBase ScrrenLanguage;
- // Use this for initialization
- public LoadingBackgroundSpermsManager LoadingBackgroundSpermsManager;
- public Loader Loader;
- void Start()
- {
- //PlayerPrefs.DeleteAll();
- //PlayerPrefs.Save();
- var l = PlayerPrefs.GetString("LanguageSelect");
- Debug.Log(l);
- if (string.IsNullOrEmpty(l))
- {
- ScrrenLanguage.Show();
- LoadingBackgroundSpermsManager.enabled = false;
- Loader.enabled = false;
- return;
- }
- if (l == "Denmark")
- {
- if (Localization.instance != null)
- {
- Localization.instance.currentLanguage = "Denmark";
- }
- }
- else
- {
- if (Localization.instance != null)
- {
- Localization.instance.currentLanguage = "Icelandic";
- }
- }
- ScrrenLanguage.Hide();
- LoadingBackgroundSpermsManager.enabled = true;
- Loader.enabled = true;
- }
- void OnDenmark () {
- ScrrenLanguage.Hide();
- if (Localization.instance != null)
- {
- Localization.instance.currentLanguage = "Denmark";
- }
- LoadingBackgroundSpermsManager.enabled = true;
- Loader.enabled = true;
- PlayerPrefs.SetString("LanguageSelect", "Denmark");
- PlayerPrefs.Save();
- }
-
- void OnIcelandic () {
- ScrrenLanguage.Hide();
- if (Localization.instance != null)
- {
- Localization.instance.currentLanguage = "Icelandic";
- }
- LoadingBackgroundSpermsManager.enabled = true;
- Loader.enabled = true;
- PlayerPrefs.SetString("LanguageSelect", "Icelandic");
- PlayerPrefs.Save();
- }
- }
|