Exemple #1
0
    private void Awake()
    {
        DontDestroyOnLoad(gameObject);
        Instance = this;
        Load();

        Debug.Log(Helper.Serialize <SaveState> (state));
    }
Exemple #2
0
    private void Awake()
    {
        if (Instance != null)
        {
            Destroy(this);
        }
        else
        {
            DontDestroyOnLoad(gameObject);
            Instance = this;
            Load();

            Debug.Log(Helper.Serialize <saveState>(state));
        }
    }
Exemple #3
0
 void Awake()
 {
     if (_instance == null)
     {
         _instance = this;
         DOTween.Init(false, true, LogBehaviour.ErrorsOnly);
         DontDestroyOnLoad(gameObject);
         if (savePlayer == null)
         {
             savePlayer            = gameObject.AddComponent <saveManager>();
             savePlayer._restaurar = true;
             savePlayer.iniciaRestore();
         }
     }
     else
     {
         DestroyImmediate(gameObject);
     }
 }
Exemple #4
0
 void Awake()
 {
     if (_instance == null)
     {
         _instance = this;
         achievs   = GetComponent <achievementManager>();
         DontDestroyOnLoad(gameObject);
         Screen.SetResolution(1280, 720, true);
         Application.targetFrameRate           = 60;
         Screen.autorotateToLandscapeLeft      = false;
         Screen.autorotateToLandscapeRight     = false;
         Screen.autorotateToPortrait           = true;
         Screen.autorotateToPortraitUpsideDown = true;
         Screen.orientation = ScreenOrientation.AutoRotation;
         jogador            = GetComponent <saveManager>();
     }
     else
     {
         DestroyImmediate(gameObject);
     }
 }