Пример #1
0
 public void LoadGame()
 {
     if (Input.GetKeyDown(KeyCode.P))
     {
         SauvegardeManager.ImportData("newSave.json");
     }
 }
Пример #2
0
 public void SaveGame()
 {
     if (Input.GetKeyDown(KeyCode.L))
     {
         Debug.Log(JsonConvert.SerializeObject(m_Inventory));
     }
     if (Input.GetKeyDown(KeyCode.O))
     {
         SauvegardeManager.ExportData("newSave.json");
     }
 }
Пример #3
0
    public void SwitchLevel()
    {
        MapGenerator.Coord myPosition = MapGenerator.ConvertWorldToIndex(transform.position);
        int myActualPosition          = GetTile(myPosition.i, myPosition.j);

        if ((myPosition.i == 2 && myPosition.j == 9) || (myPosition.i == 3 && myPosition.j == 9))
        {
            SceneManager.LoadScene("Game2");

            SauvegardeManager.ImportData("GameContentLvl2.json");
        }

        if ((myPosition.i == 2 && myPosition.j == 2) || (myPosition.i == 3 && myPosition.j == 2))
        {
            SceneManager.LoadScene("Game");

            SauvegardeManager.ImportData("GameContentLvl1.json");
        }
    }