// Update is called once per frame void Update() { if (Input.GetKeyDown(KeyCode.Alpha3)) { //Load Debug.Log("Loading data and updating text..."); UpdateText(); PersistentDataManager.LoadData(); } if (Input.GetKeyDown(KeyCode.Alpha4)) { //Save Debug.Log("Saving GameManager..."); PersistentDataManager.SaveData(); } if (Input.GetKeyDown(KeyCode.UpArrow)) { //Increment Money GameManager.gameManager.AddMoney(1); Debug.Log("Increment success!"); } if (Input.GetKeyDown(KeyCode.DownArrow)) { //Decrement Money GameManager.gameManager.AddMoney(-1); Debug.Log("Decrement success!"); } }
void Start() { if (StaticDataManager.LoadData(Application.dataPath)) { // do something with data } else { StaticDataManager.SetupDefaultData(); } //string locText = localizationDictionary["MyKey"]["en"]; if (PersistentDataManager.LoadData()) { // do something with data } else { PersistentDataManager.CreateDefaultData(); PersistentDataManager.SaveData(); } LoadLocalizationData(); }
public void SavePlayerData() { PersistentDataManager.SaveData(); }
void OnDestroy() { PersistentDataManager.SaveData(); }
void OnApplicationQuit() { PersistentDataManager.SaveData(); }
public void SetMoney(int amount) { Money = amount; PersistentDataManager.SaveData(); UpdateUI(); }