private void buy() { if (UserUnlockable.getMoney() >= value) { UserUnlockable.addMoney(-value); UserUnlockable.changeActiveItem(itemIndex, true); bought = true; valueUI.text = "OWNED"; } }
private void buy() { if (UserUnlockable.getMoney() >= value) { UserUnlockable.addMoney(-value); bought = true; valueUI.text = "OWNED"; UserUnlockable.saveWeapon(thisWeapon.getWeaponIndex(), true); } }
public static void load() { string path = Application.persistentDataPath + "/profile.sav"; if (File.Exists(path)) { BinaryFormatter formatter = new BinaryFormatter(); FileStream stream = new FileStream(path, FileMode.OpenOrCreate); playerProfile profile = formatter.Deserialize(stream) as playerProfile; UserUnlockable.addMoney(profile.money); UserUnlockable.changeActiveWeapon(profile.activeWeapon); UserUnlockable.setAllWeapons(profile.weapons); UserUnlockable.setAllItems(profile.items); stream.Close(); } else { Debug.LogError("ERROR!"); } }
private void saveData() { UserUnlockable.addMoney(currentMoney); }