Exemplo n.º 1
0
        //editor visualization
        void OnDrawGizmos()
        {
            if (bPoints.Count <= 0)
            {
                return;
            }

            //assign path ends color
            Vector3 start = bPoints[0].wp.position;
            Vector3 end   = bPoints[bPoints.Count - 1].wp.position;

            Gizmos.color = color1;
            Gizmos.DrawWireCube(start, size * GetHandleSize(start) * 1.5f);
            Gizmos.DrawWireCube(end, size * GetHandleSize(end) * 1.5f);

            //assign line and waypoints color
            Gizmos.color = color2;
            for (int i = 1; i < bPoints.Count - 1; i++)
            {
                Gizmos.DrawWireSphere(bPoints[i].wp.position, radius * GetHandleSize(bPoints[i].wp.position));
            }

            //draw linear or curved lines with the same color
            if (drawCurved && bPoints.Count >= 2)
            {
                WaypointManager.DrawCurved(pathPoints);
            }
            else
            {
                WaypointManager.DrawStraight(pathPoints);
            }
        }
Exemplo n.º 2
0
        //editor visualization
        void OnDrawGizmos()
        {
            if (waypoints.Length <= 0)
            {
                return;
            }

            //get positions
            Vector3[] wpPositions = GetPathPoints();

            //assign path ends color
            Vector3 start = wpPositions[0];
            Vector3 end   = wpPositions[wpPositions.Length - 1];

            Gizmos.color = color1;
            Gizmos.DrawWireCube(start, size * GetHandleSize(start) * 1.5f);
            Gizmos.DrawWireCube(end, size * GetHandleSize(end) * 1.5f);

            //assign line and waypoints color
            Gizmos.color = color2;
            for (int i = 1; i < wpPositions.Length - 1; i++)
            {
                Gizmos.DrawWireSphere(wpPositions[i], radius * GetHandleSize(wpPositions[i]));
            }

            //draw linear or curved lines with the same color
            if (drawCurved && wpPositions.Length >= 2)
            {
                WaypointManager.DrawCurved(wpPositions);
            }
            else
            {
                WaypointManager.DrawStraight(wpPositions);
            }
        }
        // Token: 0x0600071D RID: 1821 RVA: 0x0002EFF0 File Offset: 0x0002D3F0
        private void OnDrawGizmos()
        {
            if (this.bPoints.Count <= 0)
            {
                return;
            }
            Vector3 position  = this.bPoints[0].wp.position;
            Vector3 position2 = this.bPoints[this.bPoints.Count - 1].wp.position;

            Gizmos.color = this.color1;
            Gizmos.DrawWireCube(position, this.size * this.GetHandleSize(position) * 1.5f);
            Gizmos.DrawWireCube(position2, this.size * this.GetHandleSize(position2) * 1.5f);
            Gizmos.color = this.color2;
            for (int i = 1; i < this.bPoints.Count - 1; i++)
            {
                Gizmos.DrawWireSphere(this.bPoints[i].wp.position, this.radius * this.GetHandleSize(this.bPoints[i].wp.position));
            }
            if (this.drawCurved && this.bPoints.Count >= 2)
            {
                WaypointManager.DrawCurved(this.pathPoints);
            }
            else
            {
                WaypointManager.DrawStraight(this.pathPoints);
            }
        }
Exemplo n.º 4
0
        // Token: 0x06000725 RID: 1829 RVA: 0x0002EDC8 File Offset: 0x0002D1C8
        private void OnDrawGizmos()
        {
            if (this.waypoints.Length <= 0)
            {
                return;
            }
            Vector3[] pathPoints = this.GetPathPoints(false);
            Vector3   vector     = pathPoints[0];
            Vector3   vector2    = pathPoints[pathPoints.Length - 1];

            Gizmos.color = this.color1;
            Gizmos.DrawWireCube(vector, this.size * this.GetHandleSize(vector) * 1.5f);
            Gizmos.DrawWireCube(vector2, this.size * this.GetHandleSize(vector2) * 1.5f);
            Gizmos.color = this.color2;
            for (int i = 1; i < pathPoints.Length - 1; i++)
            {
                Gizmos.DrawWireSphere(pathPoints[i], this.radius * this.GetHandleSize(pathPoints[i]));
            }
            if (this.drawCurved && pathPoints.Length >= 2)
            {
                WaypointManager.DrawCurved(pathPoints);
            }
            else
            {
                WaypointManager.DrawStraight(pathPoints);
            }
        }