Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


callbackTargetCount

Get the number of distinct callback targets held by the bodies, chains, shapes and joints in the world. Objects that share the same callback target object count it once, however many of them there are.
Read time 1 minuteLast updated a day ago

Definition

  • Type: Property
  • Namespace: Unity.U2D.Physics
  • Assembly: UnityEngine.PhysicsCore2DModule
public int callbackTargetCount { get; }

Remarks

See PhysicsBody.callbackTarget, PhysicsChain.callbackTarget, PhysicsShape.callbackTarget and PhysicsJoint.callbackTarget. A callback target set on a shape or joint that is destroyed along with its body, or on a chain segment destroyed along with its chain, can still be counted until the world reuses that object's handle or the world is destroyed.