public void Awake() { Player = GameObject.FindGameObjectWithTag("Player"); _instance = this; if (PlayerPrefs.HasKey("MusicOn")) { if (PlayerPrefs.GetInt("MusicOn") == 1) { musicCtr.isOn = true; musicSource.enabled = true; musicSource2.enabled = true; } else { musicCtr.isOn = false; musicSource.enabled = false; musicSource2.enabled = false; } } else { musicCtr.isOn = true; musicSource.enabled = true; musicSource2.enabled = true; } }
void Start() { ctr = GameObject.FindGameObjectWithTag("Player").transform.GetChild(5).GetComponent <GameCtr>(); if (SceneManager.GetActiveScene().buildIndex == 25) { ctr.LoadGame(); } }
void Start() { ctr = GameObject.FindGameObjectWithTag("Player").transform.GetChild(5).GetComponent <GameCtr>(); ctr.LoadGame(); }
private void Awake() { Instance = this; }