private void equip() { if (!equipped) { UserUnlockable.changeActiveWeapon(thisWeapon.getWeaponIndex()); Market.Instance.unequip(); equipped = true; valueUI.text = "EQUIPED"; } }
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!"); } }