public void UnregisterFromParent() { if (transform.parent != null) { InventoryCellGroup cellGroup = transform.parent.GetComponent <InventoryCellGroup>(); if (cellGroup != null) { cellGroup.UnregisterItem(this); } InventorySlot slot = transform.parent.GetComponent <InventorySlot>(); if (slot != null) { slot.UnregisterItem(this); } } }
public void Setup(InventoryCellGroup cellGroup, int _x, int _y) { representedCellGroup = cellGroup; x = _x; y = _y; }