Beispiel #1
0
        public void OnPointerEnter(PointerEventData eventData)
        {
            //Debug.Log("OnPointerEnter");
            if (eventData.pointerDrag == null)
            {
                return;
            }

            Draggable d = eventData.pointerDrag.GetComponent <Draggable>();

            if (d != null)
            {
                d.placeholderParent = this.transform;
            }
        }
Beispiel #2
0
        public void OnPointerExit(PointerEventData eventData)
        {
            //Debug.Log("OnPointerExit");
            if (eventData.pointerDrag == null)
            {
                return;
            }

            Draggable d = eventData.pointerDrag.GetComponent <Draggable>();

            if (d != null && d.placeholderParent == this.transform)
            {
                d.placeholderParent = d.parentToReturnTo;
            }
        }