예제 #1
0
 void Destroy()
 {
     if (m_labObject != null && !(m_labObject is EleLine))
     {
         LabObjectOperateCenter.UnRegeditMove(this, m_labObject);
     }
 }
예제 #2
0
    public void OnDrag(PointerEventData eventData)
    {
        Vector3       globalMousePos;
        RectTransform m_DraggingPlane = LabEnv.NodeLab.transform as RectTransform;

        if (m_labCamera != null && m_labCamera.ScreenPointToWorldPointInRectangle(m_DraggingPlane, eventData.position, out globalMousePos))
        {
            if (PickupPos != globalMousePos)
            {
                Vector3 offset = globalMousePos - PickupPos;
                PickupPos = globalMousePos;

                bool result = CheckPositionInCamera(offset + transform.position);
                if (result)
                {
                    List <NDlabObject> l    = LabEnv.GetHighLightCircuitObject();
                    List <NDlabObject> list = new List <NDlabObject>();
                    list.AddRange(l);
                    if (list.Count < 1)
                    {
                        list.Add(m_labObject);
                    }
                    LabObjectOperateCenter.NoticeObjToMove(list, offset);
                }
            }
        }
    }
예제 #3
0
    void Start()
    {
        if (m_labObject == null)
        {
            m_labObject = GetComponent <NDlabObject>();
        }

        if (m_labObject != null)
        {
            LabObjectOperateCenter.RegeditMove(this, m_labObject);
            if (m_labObject is EleLine)
            {
                m_labCamera = LabEnv.GetCameraByType(CameraType.WireCamera);
            }
            else
            {
                m_labCamera = LabEnv.GetCameraByType(CameraType.LabCamera);
            }
        }
    }