Пример #1
0
 void OnTriggerEnter2D(Collider2D col)
 {
     Debug.Log("Ta scena" + SceneManager.GetActiveScene().buildIndex + "ilosc scen : " + SceneManager.sceneCountInBuildSettings);
     if (col.tag == "Player")
     {
         if (SceneManager.GetActiveScene().buildIndex < SceneManager.sceneCountInBuildSettings - 1)
         {
             PlayerPresistance.SaveData();
             SceneManager.LoadScene(SceneManager.GetActiveScene().buildIndex + 1);
         }
         else
         {
             SceneManager.LoadScene(0);
         }
     }
 }
Пример #2
0
 public void Save()
 {
     PlayerPresistance.SaveData(this);
 }
Пример #3
0
 public void PlayGame()
 {
     SceneManager.LoadScene(SceneManager.GetActiveScene().buildIndex + 1);
     PlayerPresistance.SaveData();
 }