Esempio n. 1
0
 private void equip()
 {
     if (!equipped)
     {
         UserUnlockable.changeActiveWeapon(thisWeapon.getWeaponIndex());
         Market.Instance.unequip();
         equipped     = true;
         valueUI.text = "EQUIPED";
     }
 }
Esempio n. 2
0
    private void OnEnable()
    {
        maxHealth          = MAX_HEALTH;
        currentWeaponIndex = UserUnlockable.getActiveWeapon();

        equipeGun();
        specialEffect();

        healthUI.setHearts(health);
    }
Esempio n. 3
0
 private void buy()
 {
     if (UserUnlockable.getMoney() >= value)
     {
         UserUnlockable.addMoney(-value);
         UserUnlockable.changeActiveItem(itemIndex, true);
         bought       = true;
         valueUI.text = "OWNED";
     }
 }
Esempio n. 4
0
 private void buy()
 {
     if (UserUnlockable.getMoney() >= value)
     {
         UserUnlockable.addMoney(-value);
         bought       = true;
         valueUI.text = "OWNED";
         UserUnlockable.saveWeapon(thisWeapon.getWeaponIndex(), true);
     }
 }
Esempio n. 5
0
    private void OnEnable()
    {
        bought = UserUnlockable.isItemActive(itemIndex);

        if (bought)
        {
            valueUI.text = "OWNED";
        }
        else
        {
            valueUI.text = value.ToString();
        }
    }
Esempio n. 6
0
    private void OnEnable()
    {
        bought = UserUnlockable.isBought(thisWeapon.getWeaponIndex());

        if (bought)
        {
            valueUI.text = "OWNED";
        }
        else
        {
            valueUI.text = value.ToString();
        }
    }
Esempio n. 7
0
    //special effect

    private void specialEffect()
    {
        if (UserUnlockable.isItemActive(SPECIAL_INDEX_HEALTH))
        {
            fullHealth();
        }

        if (UserUnlockable.isItemActive(SPECIAL_INDEX_TIME))
        {
            moreTime();
        }

        UserUnlockable.disableAllItems();
    }
Esempio n. 8
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. 9
0
    private void OnEnable()
    {
        int money = UserUnlockable.getMoney();

        currentMoney.text = money.ToString();
    }
Esempio n. 10
0
 private void saveData()
 {
     UserUnlockable.addMoney(currentMoney);
 }
Esempio n. 11
0
    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();
    }
Esempio n. 12
0
 private void Awake()
 {
     UserUnlockable.saveWeapon(0, true);
 }