Example #1
0
 public void returnToSlot()
 {
     if (lastSlot != null)
     {
         lastSlot.addItem(this);
     }
 }
Example #2
0
 private void rightClickWeapon(SlotControllerScript slot)
 {
     if (slot is WeaponSlotControllerScript)
     {
         //do nothing if we're already an weapon slot
         return;
     }
     else
     {
         var dragItem   = slot.getItem();
         var weaponSlot = dragAndDropScript.weaponSlot;
         var curWeapon  = weaponSlot.getItem();
         if (curWeapon != null)
         {
             //switch items
             slot.addItem(curWeapon);
         }
         weaponSlot.addItem(dragItem);
     }
 }
Example #3
0
 private void rightClickArmor(SlotControllerScript slot)
 {
     if (slot is EquipmentSlotControllerScript)
     {
         Debug.Log("right clicked equip slot");
         //do nothing if we're already an equipment slot
         return;
     }
     else
     {
         var   dragItem     = slot.getItem();
         Armor a            = (Armor)dragItem.item;
         var   equipSlot    = dragAndDropScript.equipmentDictionary [a.armorType];
         var   curEquipItem = equipSlot.getItem();
         if (curEquipItem != null)
         {
             //switch items
             slot.addItem(curEquipItem);
         }
         equipSlot.addItem(dragItem);
     }
 }
Example #4
0
 private bool addItemToSlot(SlotControllerScript slot, DragItemControllerScript dragItem)
 {
     return(slot.addItem(dragItem));
 }