public void EndLevel()
 {
     levelActive = false;
     vm.PauseMovement(-1);
     if (timer < personalBest)
     {
         PlayerPrefs.SetFloat("PersonalBest", timer);
         congratulationsText.text = "Congratulations, you have beaten your personal best!\nNew Perosnal Best Time: " + timer.ToString("0.00");
     }
     else
     {
         congratulationsText.text = "You were slower than your personal best\nPerosnal Best Time: " + personalBest.ToString("0.00");
     }
     endGameWindow.SetActive(true);
 }
    void GeneratePlayerLocation()
    {
        player.PauseMovement(startDelay);
        if (lm != null)
        {
            lm.SetTImerDelay(startDelay);
        }
        int n = Random.Range(0, roomSize);
        int m = 0;

        roomLayout[n, m] = -1;
        if (n > 0)
        {
            roomLayout[n - 1, m] = -2;
        }
        if (n < roomSize - 1)
        {
            roomLayout[n + 1, m] = -2;
        }
        if (m < roomSize - 1)
        {
            roomLayout[n, m + 1] = -2;
        }
    }
Beispiel #3
0
 public void OpenMenu()
 {
     opened = true;
     UpdateMenuDisplay();
     vm.PauseMovement(-1);
 }