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