Movement.OnDrawGizmosSelected C# (CSharp) 메소드

OnDrawGizmosSelected() 공개 메소드

Draws the current waypoints for an AI car
public OnDrawGizmosSelected ( ) : void
리턴 void
    public void OnDrawGizmosSelected()
    {
        if (isAI) {
            PathPlanningKart k = GetComponent<PathPlanningKart> ();
            List<Vector3> currentWayPoints = k.currentWayPoints;
            if (currentWayPoints == null) {
                return;
            }
            for (int i = 0; i < currentWayPoints.Count; i++) {
                Vector3 point = currentWayPoints [i];
                Gizmos.color = new Color (0.0f, 0.0f, 1.0f, 0.3f);
                Gizmos.DrawCube (point, new Vector3 (3.0f, 3.0f, 3.0f));

                int x = i + 1;
                if (x < currentWayPoints.Count) {
                    Gizmos.color = Color.magenta;
                    Gizmos.DrawLine (point, currentWayPoints [x]);
                }
            }
        }
    }