コード例 #1
0
 private void OnMouseDrag()
 {
     isDragging = true;
     if (!isSnapped || forceUnsnap)
     {
         var diff = HandyScript.getMouseWorldPos() - mouseStartGrabLocation;
         transform.position = startGrabLocation + diff;
     }
 }
コード例 #2
0
 private void OnMouseDown()
 {
     forceUnsnap = true;
     isDragging  = true;
     if (isConnector)
     {
         Controller.c.isDraggingConnector = true;
         Controller.c.ToggleConnectorCircles(true);
         transform.GetChild(0).GetComponent <Snapper>().connection = 0;
     }
     if (isPart)
     {
         Controller.c.isDraggingPart = true;
         foreach (Draggable d in FindObjectsOfType <Draggable>())
         {
             if (d.isConnector)
             {
                 d.ResetDraggable();
             }
         }
     }
     startGrabLocation      = transform.position;
     mouseStartGrabLocation = HandyScript.getMouseWorldPos();
 }