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

        equipeGun();
        specialEffect();

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

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

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

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

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

        UserUnlockable.disableAllItems();
    }
Beispiel #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!");
        }
    }
Beispiel #9
0
    private void OnEnable()
    {
        int money = UserUnlockable.getMoney();

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