Ejemplo n.º 1
0
    void Start()
    {
        Time.timeScale = 1;
        audioSource    = GetComponent <AudioSource>();
        gamePauseMenu  = GetComponent <PauseDialog>().m_GamePauseUI;

        //save current level as the last level loaded
        PlayerPrefs.SetString("LastLevel", SceneManager.GetActiveScene().name);
        //load game settings if available
        string filename = PlayerPrefs.GetString("LastCheckPoint");

        if (filename.StartsWith(SceneManager.GetActiveScene().name))
        {
            Debug.Log("Loading:" + filename);
            serializer.LoadFromFile(filename);
        }
    }