Esempio n. 1
0
 private void Awake()
 {
     DontDestroyOnLoad(gameObject);
     Instance = this;
     Load();
     RetrieveDataForText();
     Debug.Log(HelperSave.Serialize <SaveState> (state));
 }
Esempio n. 2
0
 public void Load()
 {
     //is there already a save?
     if (PlayerPrefs.HasKey("save"))
     {
         //takes our current save state and uses helpersave to deserialize it
         state = HelperSave.Deserialize <SaveState> (PlayerPrefs.GetString("save"));
     }
     else
     {
         state = new SaveState();
         Save();
         print("No Save, making new one");
     }
 }
Esempio n. 3
0
 //Save state of this savestate to the player prefs
 public void Save()
 {
     //turns our state into a string to serialize
     PlayerPrefs.SetString("save", HelperSave.Serialize <SaveState>(state));
 }