public static void DrawGizmos(Vector2 target, AutonomousAgent2D agent) { // Draw the arrow pointing to the target position. DrawUtil.DrawArrow(agent.transform.position, target, Color.green, 0.8f); // Emphasize the target position. DrawUtil.DrawCircle(target, 0.15f, Color.green); }
public static void DrawGizmos(AutonomousAgent2D agent, Vector2 target) { // Draw the arrow towards the target. DrawUtil.DrawArrow(agent.transform.position, target, Color.green, 0.8f, true); // Emphasize the fleeing position. DrawUtil.DrawCircle(target, 0.15f, Color.green); }
void OnDrawGizmosSelected() { // Draw the agent velocity. if (rigid != null && !rigid.velocity.IsZero()) { Vector2 velStart = transform.Position2D(); Vector2 velEnd = transform.Position2D() + rigid.velocity; DrawUtil.DrawArrow(velStart, velEnd, Color.blue, 0.5f); } }
public static void DrawGizmos(AutonomousAgent2D agent, EvadeSensor2D sensor) { if (sensor.avoid != null) { if (sensor.bUseRange) { DrawUtil.DrawCircle(agent.transform.position, sensor.avoidRange, Color.red); } DrawUtil.DrawArrow(agent.transform.position, sensor.avoid.position, Color.green, 1f, true); } }
public static void DrawGizmos(AutonomousAgent2D agent, ArriveSensor2D sensor) { // Draw the slow radius DrawUtil.DrawCircle(agent.transform.position, sensor.slowRadius, Color.green); // Draw the stop radius DrawUtil.DrawCircle(agent.transform.position, sensor.stopRadius, Color.green); // Draw a line between the agent and its target. DrawUtil.DrawArrow(agent.transform.position, sensor.target, Color.green, 1f); // Draw the target position DrawUtil.DrawCircle(sensor.target, 0.15f, Color.green); }
public void DrawGizmos() { for (int i = 0; i < Size - 1; ++i) { Vector2 start = waypoints[i]; Vector2 end = waypoints[i + 1]; // Draw a line segment between the waypoints. DrawUtil.DrawArrow(start, end, Color.cyan, 0.35f); // Draw the near threshold. DrawUtil.DrawCircle(start, nearWaypointThresh, Color.blue); } // Draw the near threshold for last waypoint since the loop only goes to Length-1. DrawUtil.DrawCircle(LastWaypoint, nearWaypointThresh, Color.blue); // Draw a line segment between the end and start waypoints. if (bLoop) { DrawUtil.DrawArrow(LastWaypoint, FirstWaypoint, Color.cyan, 0.35f); } }