public void LoadGame() { currentSceneIndex = PlayerPrefsController.GetLevelIndex(); SceneManager.LoadSceneAsync(currentSceneIndex); level.SetLevel(currentSceneIndex); musicPlayer.LevelChanged(currentSceneIndex); }
// Start is called before the first frame update void Start() { currentSceneIndex = SceneManager.GetActiveScene().buildIndex; if (currentSceneIndex == 0) { StartCoroutine(WaitForTime()); } //PlayerPrefsController.SetLevelIndex(0); savedSceneIndex = PlayerPrefsController.GetLevelIndex(); if (savedSceneIndex == 0) { if (GameObject.Find("Continue Text")) { GameObject.Find("Continue Text").GetComponent <Button>().interactable = false; } } else { if (GameObject.Find("Continue Text")) { GameObject.Find("Continue Text").GetComponent <Button>().interactable = true; } } }