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");
         }
     }
 }