Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


DrawShapeProxy

Draw a PhysicsShape.ShapeProxy.
Read time 1 minuteLast updated 12 days ago

Definition

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

DrawShapeProxy(ShapeProxy, PhysicsTransform, Color, float, DrawFillOptions)

public void DrawShapeProxy(PhysicsShape.ShapeProxy shapeProxy, PhysicsTransform transform, Color color, float lifetime = 0, PhysicsWorld.DrawFillOptions drawFillOptions = DrawFillOptions.Outline)

Parameters

shapeProxy

The ShapeProxy to draw.

The transform to use on the specified points.

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.

drawFillOptions

Controls what aspects of the primitive is drawn.

DrawShapeProxy(ReadOnlySpan<ShapeProxy>, PhysicsTransform, Color, float, DrawFillOptions)

Draw the specified span of PhysicsShape.ShapeProxy.
public void DrawShapeProxy(ReadOnlySpan<PhysicsShape.ShapeProxy> shapeProxies, PhysicsTransform transform, Color color, float lifetime = 0, PhysicsWorld.DrawFillOptions drawFillOptions = DrawFillOptions.Outline)

Parameters

The ShapeProxies to draw.

The transform to use on the specified points.

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.

drawFillOptions

Controls what aspects of the primitive is drawn.