Пример #1
0
        public override void OnPointerUp(PointerEventData eventData)
        {
            if (hoverItem != null)
            {
                unityEvent.Invoke();

                if (!hoverItem.successful)
                {
                    inventory.AddItem(hoverItem.item, index);
                }

                Destroy(hoverItem.gameObject);
                hoverItem = null;
            }
        }
Пример #2
0
        public override void OnPointerDown(PointerEventData eventData)
        {
            if (item != null)
            {
                GameObject gobj = Instantiate(NSInventory.Resources.Instance.hoverItem);

                gobj.transform.position = transform.position;

                hoverItem      = gobj.GetComponent <HoverItem>();;
                hoverItem.item = item;

                unityEvent.AddListener(hoverItem.OnMouseReleased);

                item = null;
                inventory.RemoveItem(index);
            }
        }