Example #1
0
 public void OnDeselect(vItemSlot slot)
 {
     if (equipSlots.Contains(slot as vEquipSlot))
     {
         currentSelectedSlot = null;
     }
 }
Example #2
0
 public void OnSubmitSlot(vItemSlot slot)
 {
     if (itemPicker != null)
     {
         currentSelectedSlot = slot as vEquipSlot;
         itemPicker.gameObject.SetActive(true);
         itemPicker.CreateEquipmentWindow(inventory.items, currentSelectedSlot.itemType, slot.item, OnPickItem);
     }
 }
Example #3
0
 public void RemoveItem(vEquipSlot slot)
 {
     if (slot)
     {
         vItem item = slot.item;
         if (ValidSlots[indexOfEquipedItem].item == item)
         {
             lastEquipedItem = item;
         }
         slot.RemoveItem();
         onUnequipItem.Invoke(this, item);
     }
 }
Example #4
0
        public void OnSelectSlot(vItemSlot slot)
        {
            if (equipSlots.Contains(slot as vEquipSlot))
            {
                currentSelectedSlot = slot as vEquipSlot;
            }
            else
            {
                currentSelectedSlot = null;
            }

            onSelectEquipArea.Invoke(this);

            if (itemtext != null)
            {
                if (slot.item == null)
                {
                    itemtext.text = "";
                }
                else
                {
                    text = new StringBuilder();
                    text.Append(slot.item.name + "\n");
                    text.AppendLine(slot.item.description);
                    if (slot.item.attributes != null)
                    {
                        for (int i = 0; i < slot.item.attributes.Count; i++)
                        {
                            var _text = InsertSpaceBeforeUpperCAse(slot.item.attributes[i].name.ToString());
                            text.AppendLine(_text + " : " + slot.item.attributes[i].value.ToString());
                        }
                    }

                    itemtext.text = text.ToString();
                }
            }
        }