//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // * New Method: On Challenge Finish //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ private void OnChallengeFinish() { // Show Results? bool bShowResults = m_eChallengeActivity == ChallengeActivity.CHALLENGE_MODE; // Was Challenge Mode? Then we can update the feathers as needed if (bShowResults && !TutorialManager_Base.TutorialOpened) { ChallengeGameScoreManager.ScoreResult eScoreResult = ChallengeGameScoreManager.GetScoreResult(Mathf.CeilToInt(sm_fScore * 100.0f)); int iChallengeScore = (eScoreResult == ChallengeGameScoreManager.ScoreResult.TERRIBLE) ? 0 : (eScoreResult == ChallengeGameScoreManager.ScoreResult.OKAY) ? 1 : (eScoreResult == ChallengeGameScoreManager.ScoreResult.GOOD) ? 2 : 3; int iCompletionCount = SavedPreferenceTool.GetInt(m_ePlaylistTrack.ToString() + "_FeatherCount", 0); if (iChallengeScore > iCompletionCount) { ChallengeFeathersInfo.NewlyObtainedFeathers = (iChallengeScore - iCompletionCount); SavedPreferenceTool.SaveInt(m_ePlaylistTrack.ToString() + "_FeatherCount", iChallengeScore); // Save to the Challenge itself, now you'll see these feathers light up when in the challenge select! ChallengeFeathersInfo.AccumulatedFeathers += ChallengeFeathersInfo.NewlyObtainedFeathers; // Add to the total accumulated Feathers } else { ChallengeFeathersInfo.NewlyObtainedFeathers = 0; } } // Stop Active Challenge! m_rGameManager.StopChallenge(bShowResults); StopBackingTrack(); }
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // * New Method: Begin Fadein //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ public void BeginFadein(SoundsRhythmMemoryGame.Playlist a_eChallengeID, int a_iScore, UnlockedItems a_eUnlockedItems) { m_eCurrentChallengeID = a_eChallengeID; m_eUnlockedItem = a_eUnlockedItems; int iAccFeathers = ChallengeFeathersInfo.PreviouslyAccumulatedFeathers; m_rChallengeFeatherNotificationText.text = "x" + (iAccFeathers < 10 ? "0" :"") + iAccFeathers.ToString(); // Stop Coroutine if active! if (m_ShowAwardedFeathersCoroutine != null) { StopCoroutine(m_ShowAwardedFeathersCoroutine); } // Joko's Reaction Settings ChallengeGameScoreManager.ScoreResult eScoreResult = ChallengeGameScoreManager.GetScoreResult(a_iScore); m_eReactionMode = (eScoreResult == ChallengeGameScoreManager.ScoreResult.GREAT) ? ReactionMode.GREAT : (eScoreResult == ChallengeGameScoreManager.ScoreResult.GOOD) ? ReactionMode.GOOD : (eScoreResult == ChallengeGameScoreManager.ScoreResult.OKAY) ? ReactionMode.OKAY : ReactionMode.DEFEATED; // EXP Bar Settings m_fAcquiredScore = ((float)a_iScore / 100); m_imgExperienceBar.fillMethod = (a_iScore > 99 ? UnityEngine.UI.Image.FillMethod.Radial180 : UnityEngine.UI.Image.FillMethod.Horizontal); m_sprJokosReaction.sprite = m_arReactions[(int)m_eReactionMode].reactionImage; // Feather Options m_aSprFeathers[0].sprite = (eScoreResult != ChallengeGameScoreManager.ScoreResult.TERRIBLE ? m_sprEnabledFeatherSprite : m_sprDisabledFeatherSprite); m_aSprFeathers[1].sprite = ((eScoreResult == ChallengeGameScoreManager.ScoreResult.GOOD || eScoreResult == ChallengeGameScoreManager.ScoreResult.GREAT) ? m_sprEnabledFeatherSprite : m_sprDisabledFeatherSprite); m_aSprFeathers[2].sprite = (eScoreResult == ChallengeGameScoreManager.ScoreResult.GREAT ? m_sprEnabledFeatherSprite : m_sprDisabledFeatherSprite); // Toggle animation and disable user input for now ShowFirstAnimationFrames(); m_eTransitionPhase = TransitionPhase.CHALLENGE_MODE; m_bFadeinResults = true; ButtonManager.ToggleAllButtons(false); }