Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


SetSelectedDrawing(ReadOnlySpan<PhysicsJoint>, bool)

Set the selected drawing state on a batch of joints.
Read time 1 minuteLast updated 2 days ago

Definition

  • Type: Method
  • Namespace: Unity.U2D.Physics
  • Assembly: UnityEngine.PhysicsCore2DModule
public static int SetSelectedDrawing(ReadOnlySpan<PhysicsJoint> joints, bool selected)

Parameters

The joints to set the selected drawing state on.

selected

The selected drawing state to set on every joint.

Returns

Type

Description

intThe number of joints that were ignored (not set because the joint was invalid). A single warning is logged when any are ignored.

Remarks

The joints can belong to different worlds; the world of each joint is locked only when it changes across the batch, so joints should be ordered by world for the fewest locks. Any invalid joint in the batch is ignored. See _selectedDrawing for what the state controls.