예제 #1
0
파일: Menu.cs 프로젝트: gabidron/retroGame
    public void ContinueGame()
    {
        SoundManager.instance.StopSound();
        string  json1    = File.ReadAllText(Application.dataPath + "/lastPos.json");
        lastPos position = JsonUtility.FromJson <lastPos>(json1);

        playerMovement.loadPosition(position.pos);
        spawnPoint.ifToSpawn(false);
        PauseMenu.GameIsPaused = false;
        SceneManager.LoadScene(position.scene);

        Cursor.visible = false;
    }
예제 #2
0
    public void MainMenu()
    {
        Scene currentScene = SceneManager.GetActiveScene();

        lastPos position = new lastPos();

        position.pos   = rb.position;
        position.scene = currentScene.name;
        string json = JsonUtility.ToJson(position);

        File.WriteAllText(Application.dataPath + "/lastPos.json", json);
        Time.timeScale = 1;
        SceneManager.LoadScene("Menu");
    }