Example #1
0
    public void OnDrag(PointerEventData eventData)
    {
        NDLineLeap leap = GetComponent <NDLineLeap>();

        if (leap != null && leap.Link != null)
        {
            if (m_lineAction.m_line != null)
            {
                m_lineAction.SetControling();
                leap.Link.BreakLinkLine(m_lineAction.m_line.LabObjID);
            }
        }

        if (leap != null)
        {
            leap.ShowCanLinkLeap();
        }

        Vector3 globalMousePos;

        if (LabEnv.NodeLab.transform != null && m_camera != null)
        {
            RectTransform m_DraggingPlane = LabEnv.NodeLab.transform as RectTransform;
            if (m_camera.ScreenPointToWorldPointInRectangle(m_DraggingPlane, eventData.position, out globalMousePos))
            {
                if (m_lineAction != null)
                {
                    m_lineAction.SetControling();
                    transform.position = globalMousePos;
                }
            }
        }
    }
Example #2
0
 public void BeakLinkLeap(NDCircuitLeap leap)
 {
     if (leap != null)
     {
         NDLineLeap l = null;
         if (leap == StartLineLeap.Link)
         {
             StartLineLeap.SetBreakPos(leap.transform);
             StartLineLeap.Link = null;
         }
         else if (leap == EndLineLeap.Link)
         {
             EndLineLeap.SetBreakPos(leap.transform);
             EndLineLeap.Link = null;
         }
         leap.RemoveLinkLine(this);
         m_LineAction.SetControling();
     }
 }