void Awake() { if ( instance != null && instance != this ) { Destroy( this.gameObject ); return; } else { instance = this; } DontDestroyOnLoad( this.gameObject ); }
void Awake() { if (instance != null && instance != this) { Destroy(this.gameObject); return; } else { instance = this; } DontDestroyOnLoad(this.gameObject); }
void ChangeScene() { if (SceneName.Length == 0) { Debug.Log("Scene not found"); return; } //mSound.playSound("click"); mSound = GetComponent <MainMenuSound>(); if (mSound != null) { mSound.playSound("click"); } if (SoundClick != null) { SoundClick.Play(); } preChangeScene(); // Debug.Log ("ChangeScene OnReleaseEvent"); SceneMgr.ChangeScene(SceneName); }