void DetectAction() { if (mouseIsDown) { if (currentSlot == null) //슬롯에 저장된 아이템이 없으면 리턴 { return; } currentSlot.OnClick(this); //슬롯 아이템 클릭 } if (mouseIsUp) { if (currentSlot == null) { return; } currentSlot.OnDropItem(this); //슬롯 아이템 드랍 } }
void DetectAction() { if (mouseIsDown) { if (currentItem == null) { if (currentSlot == null) { return; } currentSlot.OnClick(this); } } if (mouseIsUp) { if (currentItem != null) { if (currentSlot != null) { currentSlot.OnDropItem(currentItem, this); } } if (currentItem != null) { SetItemOnStoredSlot(currentItem); } currentItem = null; storedSlot = null; mouseIcon.sprite = null; mouseIcon.enabled = false; } }