private void Start() { if (itemStack != null) { itemImage.texture = itemStack.data.itemInHUD; stackNumberUI.text = itemStack.sizeStack.ToString(); } if (fromSlot != null) { rectTransform.anchoredPosition = fromSlot.GetComponent <RectTransform> ().anchoredPosition; inSlot = true; } }
public void setSlot(SlotUI newSlot) { if (fromSlot != null) { fromSlot.removeCurrentItem(); } if (newSlot != null) { rectTransform.SetParent(newSlot.GetComponent <RectTransform> ().parent, false); } fromSlot = newSlot; }