Beispiel #1
0
        public void OnBeginDrag(PointerEventData eventData)
        {
            if (active)
            {
//				SoundManager.instance.PlayClickSound ();
                itemBeingDragged = this;
                startPosition    = transform.position;
                GetComponent <CanvasGroup> ().blocksRaycasts = false;
            }
        }
Beispiel #2
0
        public void OnDrop(PointerEventData eventData)
        {
            DraggerHandler target = DraggerHandler.itemBeingDragged;

            if (view.CanDropInSlot(target, this))
            {
                target.Dropped();
                target.OnEndDrag();
                view.Dropped(target, this);
            }
        }
Beispiel #3
0
        public void OnEndDrag(PointerEventData eventData = null)
        {
            if (active)
            {
                //SoundController.GetController().PlayClickSound ();
                itemBeingDragged = null;
                GetComponent <CanvasGroup> ().blocksRaycasts = true;

                if (!dropped)
                {
                    transform.position = startPosition;
                }
                else
                {
                    SetActive(false);
                }

                if (dropped && !activeOnDrop)
                {
                    dropped = false;
                    gameObject.SetActive(false);
                }
            }
        }
Beispiel #4
0
 abstract public bool CanDropInSlot(DraggerHandler dropper, DraggerSlot slot);
Beispiel #5
0
 abstract public void Dropped(DraggerHandler dropped, DraggerSlot where);