Exemplo n.º 1
0
 void Awake()
 {
     ready    = true;
     playSong = new MPlaySong {
         songSource = GetComponent <AudioSource>()
     };
 }
Exemplo n.º 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;
        }
Exemplo n.º 3
0
 void Awake()
 {
     stopSong = new MStopSong();
     playSong = new MPlaySong {
         songSource = GetComponent <AudioSource>()
     };
     logSong = new MAnalyticSong();
 }
Exemplo n.º 4
0
 private void OnPlaySong(MPlaySong msg)
 {
     if (msg.songIndex == playSong.song &&
         !msg.otherSongPlaying)
     {
         stars.DisableTap();
     }
 }