Beispiel #1
0
 void Awake()
 {
     stopSong = new MStopSong();
     playSong = new MPlaySong {
         songSource = GetComponent <AudioSource>()
     };
     logSong = new MAnalyticSong();
 }
Beispiel #2
0
        private void OnStopSong(MStopSong stopSong)
        {
            if (curSong < 0)
            {
                return;
            }

            FadeIn(chAmbient);
            FadeOut(chMusic);

            mSongDone.songIndex = curSong;
            msg.Dispatch(mSongDone);
            curSong = -1;
            source.Stop();
            source.clip = null;
        }