예제 #1
0
    public void ItemRetrieve(Item.itemStruct targetItem) // check item that is recieved from the inventory manager to see if its name matches any of the lore tabs in the loreObjects list
    {
        //retrieves the information for any item sent from the inventory manager
        for (int i = 0; i < allLoreTabs.Count; i++)
        {
            if (allLoreTabs[i].name == targetItem.thisObject.name) //if the items name matches any of the lore entry names, create a copy and then parent it to that lore entry
            {
                var loreCopy = Instantiate(targetItem.thisObject as GameObject, allLoreTabs[i].transform);
                loreCopy.SetActive(true);
                allLoreTabs[i].GetComponent <OnLorePress>().TextUpdate(loreCopy.GetComponent <Item>().itemStats.description);

                break;
            }
        }
    }
예제 #2
0
    public void ItemRetrieve(Item.itemStruct targetItem)
    {
        for (int i = 0; i < allSlots; i++)
        {
            if (slot[i].GetComponent <Slot>().empty)
            {
                //add item to slot
                targetItem.pickedUp = true;

                slot[i].GetComponent <Slot>().item        = targetItem.thisObject;
                slot[i].GetComponent <Slot>().icon        = targetItem.icon;
                slot[i].GetComponent <Slot>().type        = targetItem.type;
                slot[i].GetComponent <Slot>().description = targetItem.description;
                slot[i].GetComponent <Slot>().ID          = targetItem.ID;

                slot[i].GetComponent <Slot>().bonusStats[0]  = targetItem.strBonus;
                slot[i].GetComponent <Slot>().bonusStats[1]  = targetItem.elecBonus;
                slot[i].GetComponent <Slot>().bonusStats[2]  = targetItem.agiBonus;
                slot[i].GetComponent <Slot>().bonusStats[3]  = targetItem.combatBonus;
                slot[i].GetComponent <Slot>().bonusStats[4]  = targetItem.scanBonus;
                slot[i].GetComponent <Slot>().bonusStats[5]  = targetItem.effBonus;
                slot[i].GetComponent <Slot>().bonusStats[6]  = targetItem.hitBonus;
                slot[i].GetComponent <Slot>().bonusStats[7]  = targetItem.retBonus;
                slot[i].GetComponent <Slot>().bonusStats[8]  = targetItem.ventBonus;
                slot[i].GetComponent <Slot>().bonusStats[9]  = targetItem.objMBonus;
                slot[i].GetComponent <Slot>().bonusStats[10] = targetItem.regenBonus;
                slot[i].GetComponent <Slot>().bonusStats[11] = targetItem.luckBonus;
                slot[i].GetComponent <Slot>().bonusStats[12] = targetItem.teamPBonus;
                slot[i].GetComponent <Slot>().bonusStats[13] = targetItem.infoBonus;

                targetItem.thisObject.SetActive(false);

                slot[i].GetComponent <Slot>().UpdateSlot();
                slot[i].GetComponent <Slot>().empty = false;

                return;
            }
        }
    }