private void equip() { if (!equipped) { UserUnlockable.changeActiveWeapon(thisWeapon.getWeaponIndex()); Market.Instance.unequip(); equipped = true; valueUI.text = "EQUIPED"; } }
private void OnEnable() { maxHealth = MAX_HEALTH; currentWeaponIndex = UserUnlockable.getActiveWeapon(); equipeGun(); specialEffect(); healthUI.setHearts(health); }
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); } }
private void OnEnable() { bought = UserUnlockable.isItemActive(itemIndex); if (bought) { valueUI.text = "OWNED"; } else { valueUI.text = value.ToString(); } }
private void OnEnable() { bought = UserUnlockable.isBought(thisWeapon.getWeaponIndex()); if (bought) { valueUI.text = "OWNED"; } else { valueUI.text = value.ToString(); } }
//special effect private void specialEffect() { if (UserUnlockable.isItemActive(SPECIAL_INDEX_HEALTH)) { fullHealth(); } if (UserUnlockable.isItemActive(SPECIAL_INDEX_TIME)) { moreTime(); } UserUnlockable.disableAllItems(); }
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 OnEnable() { int money = UserUnlockable.getMoney(); currentMoney.text = money.ToString(); }
private void saveData() { UserUnlockable.addMoney(currentMoney); }
private void simpleGameOver() { saveData(); gameoverScreen.SetActive(true); gameoverScreen.transform.GetChild(0).GetComponent <TextMeshProUGUI>().text = "TIME SURVIVED : " + ((int)gameTimer).ToString() + "s"; gameoverScreen.transform.GetChild(1).GetChild(0).GetComponent <TextMeshProUGUI>().text = UserUnlockable.getMoney().ToString(); camera.stopFollow(); }
private void Awake() { UserUnlockable.saveWeapon(0, true); }