예제 #1
0
    /// <summary>
    ///     Draws the way points.
    /// </summary>
    private void DrawWayPoints()
    {
        _vectorLine.ClearPoints();

        if (_targetSpot == null)
        {
            return;
        }

        if (_gameState == States.Setting)
        {
            _vectorLine.AddPoint(transform.position);

            foreach (var hpt in _wayPoints)
            {
                _vectorLine.AddPoint(hpt.PosVector);
            }

            _targetSpot.GetComponent <MeshRenderer>().enabled = true;
            _targetSpot.transform.position = _wayPoints[_wayPoints.Count - 1].PosVector;

            _vectorLine.ForceDraw();
        }
        else
        {
            _targetSpot.GetComponent <MeshRenderer>().enabled = false;
            _vectorLine.ForceClear();
        }
    }