Exemplo n.º 1
0
    IEnumerator JustWait()
    {
        yield return(new WaitForSeconds(0));

        if (invPlayer.addToInventory(nameOfItem, Collection, typeOfItem, priceOfItem, valueProperty))
        {
            invPlayer.addCoin(-priceOfItem);
            ChangeEquipment.changeWeapon(nameOfItem, Collection, typeOfItem);
        }
    }
Exemplo n.º 2
0
    public void Equip()
    {
        ChangeEquipment = GameObject.FindGameObjectWithTag("Character").GetComponent <ChangeWeapon>();

        foreach (List <string> equipment in inventoryArray)
        {
            string nameOfItem = equipment[0];
            string collection = equipment[1];
            string typeOfItem = equipment[2];
            ChangeEquipment.changeWeapon(nameOfItem, collection, typeOfItem);
            foreach (List <int> valueProperty in inventoryIntArray)
            {
                if (typeOfItem.ToLower() == "sword")
                {
                    attack = valueProperty[1];
                }
                else if (typeOfItem.ToLower() == "armour")
                {
                    //add defence, but did it in buy item instead
                }
            }
        }
    }