protected override void Awake() { base.Awake(); UnityEngine.Object.DontDestroyOnLoad(this); m_AudioSource = GetComponent(typeof(AudioSource)) as AudioSource; m_AudioListenerCtrl = GetComponent(typeof(AudioListenerCtrl)) as AudioListenerCtrl; MusicPlayer.musicPlayer = this; }
void OnDestroy() { m_AudioListenerCtrl = null; m_AudioSource = null; MusicPlayer.musicPlayer = null; }