public TerrainOverlayLine AddLine(Material material, string name = null)
        {
            TerrainOverlayLine overlayLine = AddObject <TerrainOverlayLine>(name);

            overlayLine.Material = material;
            _overlayObjects.Add(overlayLine);
            return(overlayLine);
        }
예제 #2
0
        public void ResumeSelection()
        {
            if (SelectionInputEnabled)
            {
                return;
            }
            SelectionInputEnabled = true;
            ControllerModalShowResults(false);
            if (_points.Count == 0)
            {
                return;
            }

            // Re-add the "current line".
            TerrainOverlayLine overlayLine = _overlayController.AddLine(_newLineMaterial);

            overlayLine.BaseThickness = 5e-3f; // TODO Unhardcode this
            _overlayLines.Push(overlayLine);
            _overlayController.UpdateTexture();
        }
예제 #3
0
        public void UpdateCursorPosition(RaycastHit hit)
        {
            if (!SelectionInputEnabled)
            {
                return;
            }
            Vector2 currentPoint = hit.textureCoord;

            ControllerModalUpdateCurrentPoint(currentPoint);
            if (_points.Count == 0)
            {
                return;
            }
            Vector2 previousPoint = _points.Peek();

            if (_overlayLines.Count > 0)
            {
                TerrainOverlayLine currentOverlayLine = _overlayLines.Peek();
                currentOverlayLine.UpdateLine(previousPoint, currentPoint);
                _overlayController.UpdateTexture();
            }
        }
예제 #4
0
        public void MakeSelection(RaycastHit hit)
        {
            if (!SelectionInputEnabled)
            {
                return;
            }
            Vector2 newPoint = hit.textureCoord;

            if (_points.Count > 0 && _overlayLines.Count > 0)
            {
                Vector2            previousPoint      = _points.Peek();
                TerrainOverlayLine currentOverlayLine = _overlayLines.Peek();
                currentOverlayLine.UpdateLine(previousPoint, newPoint);
                currentOverlayLine.Material = _lineMaterial;
            }
            _points.Push(newPoint);
            TerrainOverlayLine overlayLine = _overlayController.AddLine(_newLineMaterial);

            overlayLine.BaseThickness = 5e-3f; // TODO Unhardcode this
            _overlayLines.Push(overlayLine);
            _overlayController.UpdateTexture();
            ControllerModalAddPoint(newPoint);
        }