public void turnMusicOff() { if (_instance != null) { this.gameObject.GetComponent <AudioSource>().Stop(); Destroy(this.gameObject); MusicMenuPlay._instance = null; } }
void Awake() { if (!_instance) { _instance = this; } else { Destroy(this.gameObject); } DontDestroyOnLoad(this.gameObject); }