Exemplo n.º 1
0
    void MouseDownEvent()
    {
        if (Input.GetMouseButtonDown(0) && !isInsert)
        {
            Vector2        mousePos = Camera.main.ScreenToWorldPoint(Input.mousePosition);
            RaycastHit2D[] hitArray = Physics2D.RaycastAll(mousePos, Vector2.zero);

            for (int i = 0; i < hitArray.Length; i++)
            {
                if (hitArray[i].collider.gameObject.name.Contains("Clone") && this.currentChoiceNode == null)
                {
                    currentChoiceNode = hitArray[i].transform;

                    DragAndDrop dragObj = currentChoiceNode.GetComponent <DragAndDrop>();


                    ClickObjName = dragObj.name;



                    RealDragObject = dragObj;

                    dragObj.SetTraceObjfalse();


                    break;
                }
            }
        }
    }