public void OnSlotChange(InventoryUISlot newSlot, InventoryUIObject inventoryUIObject) { bool isSpecial = inventoryUIObject.GetInventoryObject() == inventory.GetSpecialInventoryObject(); // normal object to special if (isSpecial == false && newSlot == slotSpecial) { inventory.MoveNormalInventoryObjectToSpecial(inventoryUIObject.GetInventoryObject()); } // special object to normal if (isSpecial && newSlot != slotSpecial) { inventory.MoveSpecialInventoryObjectToNormal(inventoryUIObject.GetInventoryObject()); } // set wish pos if (newSlot != slotSpecial) { inventoryUIObject.GetInventoryObject().SetCurrentPos(slots.IndexOf(newSlot)); } else { inventoryUIObject.GetInventoryObject().SetCurrentPos(0); } }
public void SelectInventoryUIObject(InventoryUIObject inventoryUIObject) { textTitle.text = inventoryUIObject.GetInventoryObject().GetTitle(); textDescription.text = inventoryUIObject.GetInventoryObject().GetDescription(); panelDescription.SetActive(true); currentSelectedInventoryUIObject = inventoryUIObject; }
public void DropCurrentSelectedInventoryUIObject() { inventory.RemoveInventoryObject(currentSelectedInventoryUIObject.GetInventoryObject()); if (onDropInventoryUIObject != null) { onDropInventoryUIObject(currentSelectedInventoryUIObject); } panelDescription.SetActive(false); }
public void OnDrop(InventoryUIObject inventoryUIObject) { Instantiate(inventoryUIObject.GetInventoryObject().GetPrefab(), transform.position, Quaternion.identity); onDrop.Invoke(); }