コード例 #1
0
 public void Drag(int slot, Transform con)
 {
     if (con == slotsContainer)
     {
         Vector2Int sl = inv.GetSlot(slot);
         createDrag(sl);
         inv.RemoveFromSlots(slot);
         SetItem(inv.GetSlot(slot), slotsContainer.GetChild(slot));
     }
     else if (con == toolsContainer)
     {
         Vector2Int sl = inv.GetTool(slot);
         createDrag(sl);
         inv.RemoveFromTools(slot);
         SetItem(inv.GetTool(slot), toolsContainer.GetChild(slot));
         SetItem(inv.GetTool(slot), toolsDisplay.GetChild(slot));
         SelectTool(false);
         SelectTool(true);
     }
     else if (con == activeContainer)
     {
         Vector2Int sl = inv.GetActive(slot);
         createDrag(sl);
         inv.RemoveFromActive(slot);
         SetItem(inv.GetActive(slot), activeContainer.GetChild(slot));
         AddActive(Vector2Int.zero, slot);
     }
 }