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