private void Update() { if (IsPickedItem && Input.GetMouseButtonDown(0) && !UnityEngine.EventSystems.EventSystem.current.IsPointerOverGameObject(-1)) { PickedItemKeeper.ReduceAmount(PickedItemKeeper.Amount); } Vector2 position; RectTransformUtility.ScreenPointToLocalPointInRectangle(canvas.transform as RectTransform, Input.mousePosition, null, out position); if (isTooltipShow) { toolTip.SetLocalPotion(position + toolTipPosionOffset); } if (IsPickedItem) { PickedItemKeeper.SetLocalPotion(position + toolTipPosionOffset); } }
public void ReducePickedItem(int amount = 1) { PickedItemKeeper.ReduceAmount(amount); }