Beispiel #1
0
 public void LoadUnlockedLevel(int phaseNum)
 {
     if (PlayerPrefManagement.Unlocked(phaseNum))
     {
         LoadLevel("Phase" + phaseNum + "_01");
     }
 }
    void Start()
    {
        UnlockConditions();

        Text[] lockedTexts = { locked_2, locked_3, locked_4, locked_5 };

        for (int i = 0; i < lockedTexts.Length; i++)
        {
            if (PlayerPrefManagement.Unlocked(i + 2))
            {
                lockedTexts [i].text = "";
            }
        }
    }
    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 = "";
        }
    }