Esempio n. 1
0
    //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    //	* 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();
    }
Esempio n. 2
0
 //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 //	* New Method: Load Saved Preference
 //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 protected void LoadSavedPreference()
 {
     if (m_bSavePreference)
     {
         int newIndex = SavedPreferenceTool.GetInt(m_sSavedKeyPreference, m_iSelectedIndex);
         if (newIndex != m_iSelectedIndex)
         {
             int previousIndex = m_iSelectedIndex;
             m_iSelectedIndex = newIndex;
             OnLoadSavedIndex(previousIndex);
         }
     }
 }
Esempio n. 3
0
    //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    //	* Derived Method: Awake
    //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    void Awake()
    {
        // Switch to the appropriate instrument type, saved during the last game. Can only change Instruments permanently in full version of app~
        InstrumentMode eSavedInstrumentMode = m_eCurrentInstrumentMode;

        //if(GameManager.IsFullVersion)
        eSavedInstrumentMode = (InstrumentMode)SavedPreferenceTool.GetInt("InstrumentMode", (int)InstrumentMode.RIQ_TAMBOURINE);

        if (eSavedInstrumentMode != m_eCurrentInstrumentMode)
        {
            SetInstrumentMode(eSavedInstrumentMode);
        }
    }
    //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    //	* Derived Method: On Enable
    //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    protected override void OnEnable()
    {
        base.OnEnable();

        float newTambSize = 0.731f;

        m_bPriorTambTargetsVisible = m_rInstrumentManager.InstrumentColoursManager.Visible;
        m_ePriorInstrumentMode     = (InstrumentManager.InstrumentMode)SavedPreferenceTool.GetInt("InstrumentMode");
        m_fPriorShakeSensitivity   = SavedPreferenceTool.GetFloat("SensitivityPreference", 1.0f);
        m_fPriorInstrumentSize     = SavedPreferenceTool.GetFloat("SizePreference", newTambSize);

        m_rInstrumentManager.CurrentInstrumentMode = InstrumentManager.InstrumentMode.RIQ_TAMBOURINE;
        m_rShakeDetector.ShakeSensitivity          = 1.0f;
        m_rTambourineZoomHandler.SetValue(newTambSize);
    }
    //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    //	* New Method: Toggle Awarded Feathers
    //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    private void ToggleAwardedFeathers()
    {
        int completionCount = SavedPreferenceTool.GetInt(m_eChallengeID.ToString() + "_FeatherCount", 0);

        for (int i = 0; i < m_arAwardedFeathersNotifier.Length; ++i)
        {
            if (i < completionCount)
            {
                m_arAwardedFeathersNotifier[i].ShowActiveFeather();
            }
            else
            {
                m_arAwardedFeathersNotifier[i].ShowInactiveFeather();
            }
        }
    }
Esempio n. 6
0
 //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 //	* Derived Method: Start
 //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 protected override void Start()
 {
     base.Start();
     if (SavedPreferenceTool.GetInt("SeenTitleIntroSequence", 0) == 0)
     {
         this.gameObject.SetActive(false);
     }
     else
     {
         for (int i = 0; i < m_arDisplayAnimation.Length; ++i)
         {
             m_arDisplayAnimation[i].Setup(this.transform);
         }
         for (int i = 0; i < m_arTextDisplayAnimation.Length; ++i)
         {
             m_arTextDisplayAnimation[i].Setup(TextRenderer.transform);
         }
     }
 }
Esempio n. 7
0
 //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 //	* Derived Method: Start
 //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 void Start()
 {
     ToggleNewSelection(SavedPreferenceTool.GetInt("SelectedChallengeDifficulty", 0));
 }