public void Awake() { DontDestroyOnLoad(gameObject); if (instance == null) { instance = this; } else { Destroy(this); } }
private void Start() { GPL = GooglePlayLogin.instance; if (PlayFab.PlayFabAuthenticationAPI.IsEntityLoggedIn() == false && Social.localUser.authenticated == false && PlayGamesPlatform.Instance.localUser.authenticated == false) { PlayFabLogin.instance.LogInPlayFabOS(); } else { LoadingScreen.SetActive(false); LoadingScreen2.SetActive(false); } LANG = LanguajesDic.instance; if (PlayerPrefs.GetInt("FirstTime") != 1) { PlayerPrefs.SetInt("FirstTime", 1); switch (Application.systemLanguage) { case SystemLanguage.English: CR.playerInfo.language = 0; LanguajesDic.instance.LoadCurrentLang(0); break; case SystemLanguage.French: CR.playerInfo.language = 2; LanguajesDic.instance.LoadCurrentLang(2); break; case SystemLanguage.Spanish: CR.playerInfo.language = 1; LanguajesDic.instance.LoadCurrentLang(1); break; case SystemLanguage.Chinese: case SystemLanguage.ChineseSimplified: case SystemLanguage.ChineseTraditional: CR.playerInfo.language = 0; LanguajesDic.instance.LoadCurrentLang(0); break; default: CR.playerInfo.language = 0; LanguajesDic.instance.LoadCurrentLang(0); break; } } GPL.GetMMA(instance); if (PlayGamesPlatform.Instance.IsAuthenticated()) { //UpdateTexts(); } PlayFabLogin.instance.GetVIV(CR.playerInfo, instance, EnvironmentController.instance, debugText, logInWindow, PlayFabLogInText); EnvironmentController.instance.gameOverDelegate += ToogleDeadWindow; UpdateCoinsText(); UpdateMeters(); UpdateStatsText(); if (PlayFabLogin.instance.noInternet) { internetConection.SetActive(true); } else if (PlayFabLogin.instance.noInternet == false) { internetConection.SetActive(false); } }