Exemplo n.º 1
0
 // Update is called once per frame
 void Update()
 {
     if (Input.GetKeyDown(KeyCode.Space))
     {
         gameObject.SetActive(false);
         Time.timeScale = 1f;
     }
     if (Input.GetKeyDown(KeyCode.Space) && PlayerPrefs.GetInt("check") == 1)
     {
         if (File.Exists(autosave))
         {
             loading.autosave = autosave;
             loading.AutoFastLoad();
             PlayerPrefs.SetInt("RenameAutoSave", 0);
             loading.AutoSaveBetweenScens();
             gameObject.SetActive(false);
             Time.timeScale = 0.1f;
             PlayerPrefs.SetInt("check", 0);
             Debug.Log("dayn");
         }
         else
         {
             loading.filePathNotF5 = "C:/Users/" + Environment.UserName + "/Documents/" + Application.productName + "/Saves/" + PlayerPrefs.GetString("FileToLoad") + ".save";
             loading.LoadGame();
             gameObject.SetActive(false);
             Time.timeScale = 0.1f;
             PlayerPrefs.SetInt("check", 0);
             Debug.Log("dayn1");
         }
     }
 }
Exemplo n.º 2
0
 public void PressYes()
 {
     save.autosave = autosave;
     if (Application.loadedLevel == 4)
     {
         MenuControls.IDScen = 2;
     }
     else
     {
         if (Application.loadedLevel == 2)
         {
             MenuControls.IDScen = 4;
         }
     }
     PlayerPrefs.SetInt("RenameAutoSave", 1);
     save.AutoSaveBetweenScens();
     PlayerPrefs.SetInt("CurrentScene", Application.loadedLevel);
     MenuControls.check1 = true;
     SceneManager.LoadScene("loadScene");
 }