SetSelectedDrawing(ReadOnlySpan<PhysicsBody>, bool)
Set the selected drawing state on a batch of bodies.
Read time 1 minuteLast updated a day ago
Definition
- Type: Method
- Namespace: Unity.U2D.Physics
- Assembly: UnityEngine.PhysicsCore2DModule
public static int SetSelectedDrawing(ReadOnlySpan<PhysicsBody> bodies, bool selected)
Parameters
The bodies to set the selected drawing state on.
The selected drawing state to set on every body.
Returns
Type | Description |
|---|---|
| int | The number of bodies that were ignored (not set because the body was invalid). A single warning is logged when any are ignored. |
Remarks
The bodies can belong to different worlds; the world of each body is locked only when it changes across the batch, so bodies should be ordered by world for the fewest locks. Any invalid body in the batch is ignored. See _selectedDrawing for what the state controls.