private void Update()
    {
        // Incomplete line or in delete or draw mode
        if (lineInfo.controlPts.Count < 2 || lineInspectorPanel.removeLineInspectionToggle.isOn ||
            lineInspectorPanel.createLineInspectionToggle.isOn || lineInspector.CurrLineInspection == -1)
        {
            return;
        }

        var  mousePosition             = Input.mousePosition;
        bool isCursorWithinMapViewArea = inspectorTool.IsPosWithinMapViewArea(mousePosition);

        ShowControlPoints(isCursorWithinMapViewArea);

        // Inspection line is currently selected inspection line
        if (lineInfo == lineInspectorPanel.lineInfos[lineInspector.CurrLineInspection])
        {
            if (lineInspector.IsCursorNearLine(lineInfo, mousePosition, midPtOffset))
            {
                RequestToMoveLine();
                UpdateTransectHighlight();
            }
            else
            {
                inspectorTool.SetCursorTexture(inspectorTool.cursorDefault);
                lineInspectorPanel.transectController.ShowHighlight(false);
            }
        }
        else
        {
            if (lineInspector.IsCursorNearLine(lineInfo, mousePosition, midPtOffset) && isCursorWithinMapViewArea)
            {
                lineInspectorPanel.ChangeKnobsAndLine(lineInfo, false);
                if (inputHandler.IsLeftMouseDown && !inputHandler.IsDraggingLeft)
                {
                    SelectLine();
                }
            }
            else
            {
                lineInspectorPanel.ChangeKnobsAndLine(lineInfo, true);
            }
        }
    }
Exemple #2
0
    private void Update()
    {
        // Incomplete line or in delete or draw mode
        if (lineInfo.controlPts.Count < 3 || lineInspectorPanel.removeLineInspectionToggle.isOn ||
            lineInspectorPanel.createLineInspectionToggle.isOn || lineInspector.CurrLineInspection == -1)
        {
            return;
        }

        // Inspection line is currently selected inspection line
        if (lineInfo == lineInspectorPanel.lineInfos[lineInspector.CurrLineInspection])
        {
            if (lineInspector.IsCursorNearLine(lineInfo, Input.mousePosition, midPtOffset))
            {
                RequestToMoveLine();
            }
            else
            {
                inspectorTool.SetCursorTexture(inspectorTool.cursorDefault);
            }
        }
        else
        {
            if (lineInspector.IsCursorNearLine(lineInfo, Input.mousePosition, midPtOffset) &&
                inspectorTool.IsPosWithinMapViewArea(Input.mousePosition))
            {
                lineInspectorPanel.ChangeKnobsAndLine(lineInfo, false);
                if (inputHandler.IsLeftMouseDown)
                {
                    SelectLine();
                }
            }
            else
            {
                lineInspectorPanel.ChangeKnobsAndLine(lineInfo, true);
            }
        }
    }