void Update() { if (CurPlayingMode == EPlayingMode.InitialDelay) { InitialDelayTimer += Time.deltaTime; if (InitialDelayTimer > InitialDelay) { PlayingTuneCards[Iterator].SetGlow(true); AudioSourceComp.Play(); CurPlayingMode = NextPlayingMode; NextPlayingMode = EPlayingMode.None; } } else if (CurPlayingMode != EPlayingMode.None && CurPlayingMode != EPlayingMode.SingleNote) { LoopAudioList(); } else if (CurPlayingMode == EPlayingMode.SingleNote) { if (!AudioSourceComp.isPlaying) { if (!PlayingWrongNoteAnim && CurPlayingCard != null) { CurPlayingCard.SetGlow(false); CurPlayingMode = EPlayingMode.None; CurPlayingCard = null; } if (WinGame) { onEndSequencePlay(true); } } } }
public bool PlayTuneCard(TuneCardScript TuneCard) { if (CurPlayingMode != EPlayingMode.None) { return(false); } else { CurPlayingMode = EPlayingMode.SingleNote; CurPlayingCard = TuneCard; CurPlayingCard.SetGlow(true); PlayMusicNote((NoteType)CurPlayingCard.Key); return(true); } }