Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


DrawQueryResult

Draw the PhysicsQuery.CastResult returned from multiple queries. Only a result where _hit is true is drawn.
Read time 2 minutesLast updated 12 days ago

Definition

  • Type: Method
  • Namespace: Unity.U2D.Physics
  • Assembly: UnityEngine.PhysicsCore2DModule

DrawQueryResult(CastResult, Color, float, bool, bool)

Draw the PhysicsQuery.CastResult returned from multiple queries. Only a result where _hit is true is drawn.
public void DrawQueryResult(PhysicsQuery.CastResult result, Color color, float lifetime = 0, bool drawPoint = true, bool drawNormal = true)

Parameters

The result to use.

color

The color to draw with.

lifetime

How long the element should be drawn for, in seconds. The default is zero indicating that it should only be drawn once. Lifetime is only used when the world is playing.

drawPoint

Whether to draw the point in the result or not.

drawNormal

Whether to draw the normal in the result or not.

DrawQueryResult(ReadOnlySpan<CastResult>, Color, float, bool, bool)

Draw the PhysicsQuery.CastResult returned from multiple queries. Only a result where _hit is true is drawn.
public void DrawQueryResult(ReadOnlySpan<PhysicsQuery.CastResult> results, Color color, float lifetime = 0, bool drawPoint = true, bool drawNormal = true)

Parameters

The results to use.

color

The color to draw with.

lifetime

How long the element should be drawn for, in seconds. The default is zero indicating that it should only be drawn once. Lifetime is only used when the world is playing.

drawPoint

Whether to draw the point in the result or not.

drawNormal

Whether to draw the normal in the result or not.

DrawQueryResult(WorldCastResult, Color, float, bool, bool)

Draw the PhysicsQuery.WorldCastResult returned from multiple queries.
public void DrawQueryResult(PhysicsQuery.WorldCastResult result, Color color, float lifetime = 0, bool drawPoint = true, bool drawNormal = true)

Parameters

The result to use.

color

The color to draw with.

lifetime

How long the element should be drawn for, in seconds. The default is zero indicating that it should only be drawn once. Lifetime is only used when the world is playing.

drawPoint

Whether to draw the point in the result or not.

drawNormal

Whether to draw the normal in the result or not.

DrawQueryResult(ReadOnlySpan<WorldCastResult>, Color, float, bool, bool)

Draw the PhysicsQuery.WorldCastResult returned from multiple queries.
public void DrawQueryResult(ReadOnlySpan<PhysicsQuery.WorldCastResult> results, Color color, float lifetime = 0, bool drawPoint = true, bool drawNormal = true)

Parameters

The results to use.

color

The color to draw with.

lifetime

How long the element should be drawn for, in seconds. The default is zero indicating that it should only be drawn once. Lifetime is only used when the world is playing.

drawPoint

Whether to draw the point in the result or not.

drawNormal

Whether to draw the normal in the result or not.