//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // * New Method: Invoke Successful Hit //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ public void InvokeSuccessfulHit() { SprRend.sprite = m_sprSuccessSprite; AudioSourceManager.PlayAudioClip(m_acHitSound); m_rChallengeModeInfo.Score += m_rChallengeModeInfo.NoteScore; m_rChallengeModeInfo.RemoveNote(this); // !!!Change the Score During Success Animation!!! // m_eSuccessAnimationPhase = SuccessAnimationPhase.TO_SCORE; if (m_eMovementPhase == MovementPhase.AUTO_PLAY) { LocalPosition.x = m_rChallengeModeInfo.victoryLocation.x; } m_arToScoreAnimation[0].m_vStartingPosition = LocalPosition; m_eMovementPhase = MovementPhase.SUCCESS; m_iCurrentAnimationElement = 0; }
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // * New Method: Update Successful Hit! //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ private void UpdateSuccessfulHit() { if (m_eSuccessAnimationPhase == SuccessAnimationPhase.TO_SCORE) { if (m_arToScoreAnimation[m_iCurrentAnimationElement].UpdateAnimation()) { m_iCurrentAnimationElement += 1; if (m_iCurrentAnimationElement >= m_arToScoreAnimation.Length) { m_iCurrentAnimationElement = 0; m_eSuccessAnimationPhase = SuccessAnimationPhase.TO_BAG; // Update Score m_rChallengeModeInfo.IncrementScore(); // Reset Animations for (int i = 0; i < m_arToScoreAnimation.Length; ++i) { m_arToScoreAnimation[i].Reset(); } } } } else { if (m_arIntoBagAnimation[m_iCurrentAnimationElement].UpdateAnimation()) { m_iCurrentAnimationElement += 1; if (m_iCurrentAnimationElement >= m_arIntoBagAnimation.Length) { m_eMovementPhase = MovementPhase.IDLE; // Reset Animations for (int i = 0; i < m_arIntoBagAnimation.Length; ++i) { m_arIntoBagAnimation[i].Reset(); } } } } }