Esempio n. 1
0
 private void buy()
 {
     if (UserUnlockable.getMoney() >= value)
     {
         UserUnlockable.addMoney(-value);
         UserUnlockable.changeActiveItem(itemIndex, true);
         bought       = true;
         valueUI.text = "OWNED";
     }
 }
Esempio n. 2
0
 private void buy()
 {
     if (UserUnlockable.getMoney() >= value)
     {
         UserUnlockable.addMoney(-value);
         bought       = true;
         valueUI.text = "OWNED";
         UserUnlockable.saveWeapon(thisWeapon.getWeaponIndex(), true);
     }
 }
Esempio n. 3
0
    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!");
        }
    }
Esempio n. 4
0
 private void saveData()
 {
     UserUnlockable.addMoney(currentMoney);
 }