Esempio n. 1
0
    public void OnDrag(PointerEventData eventData)
    {
        if (!_editor.CanDragNode())
        {
            return;
        }

        transform.position = Input.mousePosition;
    }
Esempio n. 2
0
    public void OnDrop(PointerEventData eventData)
    {
        if (null != editor._dragedPrefab && editor.CanDragNode())
        {
            Vector2 localPos;
            RectTransformUtility.ScreenPointToLocalPointInRectangle(editor.GetModelZone(), Input.mousePosition, null, out localPos);

            editor.CreateNode(localPos, editor._dragedPrefab);
        }
    }