Esempio n. 1
0
 // Use this for initialization
 void Start()
 {
     P1.text = StopWatch.Convert(PlayerPrefManagement.GetBestPhase(1));
     P2.text = StopWatch.Convert(PlayerPrefManagement.GetBestPhase(2));
     P3.text = StopWatch.Convert(PlayerPrefManagement.GetBestPhase(3));
     P4.text = StopWatch.Convert(PlayerPrefManagement.GetBestPhase(4));
     P5.text = StopWatch.Convert(PlayerPrefManagement.GetBestPhase(5));
 }
    void Start()
    {
        rawTime        = StopWatch.time;
        timeString     = StopWatch.Convert(rawTime);
        finalTime      = this.GetComponent <Text> ();
        finalTime.text = timeString;

        phaseNum       = GameManagement.phaseNum;
        titleText.text = "Phase " + phaseNum + " Complete!";

        bestTime = false;
        HandleFinalTime();
        Selection.UnlockConditions();

        bool nextPhaseUnlocked = true;
        int  maxPhase          = 5;
        int  idx = 0;

        for (int i = 2; i <= maxPhase && nextPhaseUnlocked; i++)
        {
            if (PlayerPrefManagement.Unlocked(i))
            {
                idx = i;
            }
            else
            {
                nextPhaseUnlocked = false;
            }
        }

        if (idx != 0 && !PlayerPrefManagement.HasShownUnlockText(idx))
        {
            phaseUnlocked.text = "Phase " + idx + " Unlocked!";
            PlayerPrefManagement.MarkUnlockTextShown(idx);
        }
        else
        {
            phaseUnlocked.text = "";
        }
    }