コード例 #1
0
        public void OnBeginDrag(PointerEventData eventData)
        {
            if (active)
            {
//				SoundManager.instance.PlayClickSound ();
                itemBeingDragged = this;
                startPosition    = transform.position;
                GetComponent <CanvasGroup> ().blocksRaycasts = false;
            }
        }
コード例 #2
0
ファイル: DraggerSlot.cs プロジェクト: macraig/laFeriaDeSanti
        public void OnDrop(PointerEventData eventData)
        {
            DraggerHandler target = DraggerHandler.itemBeingDragged;

            if (view.CanDropInSlot(target, this))
            {
                target.Dropped();
                target.OnEndDrag();
                view.Dropped(target, this);
            }
        }
コード例 #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);
                }
            }
        }
コード例 #4
0
 abstract public bool CanDropInSlot(DraggerHandler dropper, DraggerSlot slot);
コード例 #5
0
 abstract public void Dropped(DraggerHandler dropped, DraggerSlot where);