void Awake() { InitializeSavedVariables(); //Initialize variables that needs to be saved when APP is closed LoadSavedVariables(); //Load the variables from Playerprefs DontDestroyOnLoad(transform.gameObject); if (Instance == null) { Instance = this; } else if (Instance != this) { Destroy(gameObject); } }
/// <summary> /// Target time to beat in seconds. /// </summary> void Awake() { DontDestroyOnLoad(transform.gameObject); if (Instance == null) { Instance = this; } else if (Instance != this) { Destroy(gameObject); } // SceneManager.sceneLoaded += SceneLoadListener; // SetUpLoadingScreen(); //Establish the loading screen and attach it to the canvas while fixing strange value artifacts // InitializeSavedVariables(); //Initialize variables that needs to be saved when APP is closed // LoadSavedVariables(); //Load the variables from Playerprefs }