Ejemplo n.º 1
0
 public void LoadCloudSave(PlayerData playerData)
 {
     PlayerData = playerData;
     MergeSaveIntoInitialData();
     CharacterSelector.RefreshCurrentCharacterDisplay();
     OnLoad?.Invoke();
 }
Ejemplo n.º 2
0
 public void Load()
 {
     if (File.Exists(Application.persistentDataPath + "/toad.dat"))
     {
         // Debug.Log("Save loaded:" + Application.persistentDataPath);
         BinaryFormatter bf   = new BinaryFormatter();
         FileStream      file = File.Open(Application.persistentDataPath + "/toad.dat", FileMode.Open);
         PlayerData = (PlayerData)bf.Deserialize(file);
         file.Close();
     }
     else
     {
         PlayerData      = new PlayerData();
         PlayerData.lang = Application.systemLanguage;
         SaveCharacters();
         Save();
     }
     MergeSaveIntoInitialData();
     CharacterSelector.RefreshCurrentCharacterDisplay();
     OnLoad?.Invoke();
 }