//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // * New Method: Start Challenge //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ public void StartChallenge() { ChallengeScore = 0.0f; VisibleScore = 0.0f; m_lActiveChallengeNotes.Clear(); m_eChallengeActivity = ChallengeActivity.CHALLENGE_MODE; foreach (Transform child in transform) { ChallengeNoteMovement cni = child.GetComponent <ChallengeNoteMovement>(); cni.Reset(); cni.BeginMovement(); m_lActiveChallengeNotes.AddLast(cni); } StartNoteMovement(); PlayBackingTrack(BackingTrackDelay); }
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // * Derived Method: On Enable //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ void OnEnable() { m_lActiveChallengeNotes.Clear(); m_eChallengeActivity = ChallengeActivity.IDLE; m_rGameManager.SetCurrentInstrument(m_eInstrumentSoundType); if (m_rInstrumentSoundTypeRenderer != null) { m_rInstrumentSoundTypeRenderer.sprite = m_sprInstrumentSoundType; } if (m_rChallengeTitleText != null) { m_oChallengeName.ApplyEffects(m_rChallengeTitleText); } //if (m_rPracticeButton != null) // m_rPracticeButton.m_ePlaylist = m_ePlaylistTrack; }
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // * New Method: Stop Challenge //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ public void StopChallenge() { StopNoteMovement(); m_lActiveChallengeNotes.Clear(); m_eChallengeActivity = ChallengeActivity.IDLE; foreach (Transform child in transform) { ChallengeNoteMovement cni = child.GetComponent <ChallengeNoteMovement>(); cni.Reset(); } StopBackingTrack(); #if UseMemoryGameManager if (m_rSoundsRhythmMemoryGame != null) { m_rSoundsRhythmMemoryGame.StopPlayback(); } #endif }
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // * New Method: Start AutoPlay //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ public void StartAutoPlay() { if (IsPracticeMode) { ResetNotations(); m_eChallengeActivity = ChallengeActivity.IDLE; #if UseMemoryGameManager if (m_rSoundsRhythmMemoryGame != null) { m_rSoundsRhythmMemoryGame.StopPlayback(); } #endif } else { ChallengeScore = 0.0f; VisibleScore = 0.0f; m_eChallengeActivity = ChallengeActivity.PRACTICE_MODE; m_lActiveChallengeNotes.Clear(); foreach (Transform child in transform) { ChallengeNoteMovement cni = child.GetComponent <ChallengeNoteMovement>(); cni.Reset(); cni.BeginAutoPlay(); m_lActiveChallengeNotes.AddLast(cni); } StartNoteMovement(); PlayBackingTrack(BackingTrackDelay); // Play Auto-Example #if UseMemoryGameManager if (m_rSoundsRhythmMemoryGame != null) { m_rSoundsRhythmMemoryGame.PlayThroughRhythmList(m_ePlaylistTrack, null, StartDelayTime); } #endif } }