public void ResetLevelsBeat()
    {
        int resetnum = 0;

        LevelSaveLoader.SaveLevelBeat(resetnum);
        EventSystem es = EventSystem.current;

        ResetPanel.SetActive(false);
        MainPanel.SetActive(true);
        es.SetSelectedGameObject(null);
        es.SetSelectedGameObject(LevelSelect);
    }
Ejemplo n.º 2
0
 private void OnTriggerEnter(Collider other)
 {
     if (other.gameObject.CompareTag("Player"))//only end level when player enters the end zone
     {
         int levelsBeat = LevelSaveLoader.LoadLevelsBeat();
         if (levelNum > levelsBeat)
         {
             LevelSaveLoader.SaveLevelBeat(levelNum);
         }
         SceneManager.LoadScene("Main_Menu");
     }
 }
Ejemplo n.º 3
0
    public void ResetLevelsBeat()
    {
        int resetnum = 0;

        LevelSaveLoader.SaveLevelBeat(resetnum);
        Vector3 reset = new Vector3(0, 1, 0);

        PlayerPositionSaveLoader.SavePlayerPosition(reset);
        EventSystem es = EventSystem.current;

        ResetPanel.SetActive(false);
        MainPanel.SetActive(true);
        es.SetSelectedGameObject(null);
        es.SetSelectedGameObject(LevelSelect);
    }
    public void SaveWithoutQuit()
    {
        PlayerPositionSaveLoader.SavePlayerPosition(transform.position);
        string levelname  = SceneManager.GetActiveScene().name;
        int    levelsbeat = 0;

        if (levelname == "Level_1")
        {
            levelsbeat = 0;
        }
        else if (levelname == "Level_2")
        {
            levelsbeat = 1;
        }
        else if (levelname == "Level_3")
        {
            levelsbeat = 2;
        }
        LevelSaveLoader.SaveLevelBeat(levelsbeat);
    }