private void Awake() { DontDestroyOnLoad(gameObject); Instance = this; Load(); Debug.Log(Helper.Serialize <SaveState> (state)); }
private void Awake() { if (Instance != null) { Destroy(this); } else { DontDestroyOnLoad(gameObject); Instance = this; Load(); Debug.Log(Helper.Serialize <saveState>(state)); } }
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); } }
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); } }