예제 #1
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);
     }
 }
예제 #2
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);
     }
 }