예제 #1
0
 void Awake()
 {
     ready    = true;
     playSong = new MPlaySong {
         songSource = GetComponent <AudioSource>()
     };
 }
예제 #2
0
        private void OnPlaySong(MPlaySong playSong)
        {
            if (playSong.songIndex < 0)
            {
                playSong.canPlay          = false;
                playSong.otherSongPlaying = false;
                return;
            }

            if (playSong.songIndex == curSong ||
                curSong >= 0)
            {
                playSong.canPlay          = false;
                playSong.otherSongPlaying = playSong.songIndex != curSong;
                return;
            }

            FadeIn(chMusic);
            FadeOut(chAmbient);

            curSong     = playSong.songIndex;
            source      = playSong.songSource;
            source.clip = songs[curSong];
            source.Play();
            playSong.canPlay          = true;
            playSong.songName         = source.clip.name;
            playSong.otherSongPlaying = false;
        }
예제 #3
0
 void Awake()
 {
     stopSong = new MStopSong();
     playSong = new MPlaySong {
         songSource = GetComponent <AudioSource>()
     };
     logSong = new MAnalyticSong();
 }
예제 #4
0
 private void OnPlaySong(MPlaySong msg)
 {
     if (msg.songIndex == playSong.song &&
         !msg.otherSongPlaying)
     {
         stars.DisableTap();
     }
 }