Beispiel #1
0
 private void Awake()
 {
     if (instance == null)
     {
         instance = this;
     }
     CheckPrefs();
 }
 private void Awake()
 {
     if (insta)
     {
         Destroy(gameObject);
     }
     else
     {
         insta = this;
         DontDestroyOnLoad(this.gameObject);
     }
 }
Beispiel #3
0
    private void Awake()
    {
        _INSTANCE = this;

        RestLifeTimer = PlayerPrefs.GetFloat("RestLifeTimer");
        DateOfExit    = PlayerPrefs.GetString("DateOfExit", "");
        Lifes         = PlayerPrefs.GetInt("Lifes");
        if (PlayerPrefs.GetInt("Lauched") == 0)
        {
            FirstTime = true;
            Lifes     = CapOfLife;
            PlayerPrefs.SetInt("Lifes", Lifes);
            PlayerPrefs.SetInt("Lauched", 1);
            PlayerPrefs.Save();
        }
    }
        private void InitConfig()
        {
            try
            {
                ISharedPreferences pref = PrefManager.GetPreferences(ApplicationContext);
                MGlobalConfig.SetVideoDimenIndex(pref.GetInt(Constants.PrefResolutionIdx, Constants.DefaultProfileIdx));

                bool showStats = pref.GetBoolean(Constants.PrefEnableStats, false);
                MGlobalConfig.SetIfShowVideoStats(showStats);
                MStatsManager.EnableStats(showStats);

                MGlobalConfig.SetMirrorLocalIndex(pref.GetInt(Constants.PrefMirrorLocal, 0));
                MGlobalConfig.SetMirrorRemoteIndex(pref.GetInt(Constants.PrefMirrorRemote, 0));
                MGlobalConfig.SetMirrorEncodeIndex(pref.GetInt(Constants.PrefMirrorEncode, 0));
            }
            catch (Exception e)
            {
                Methods.DisplayReportResultTrack(e);
            }
        }