Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


callbackTarget

Get/Set the Object that callbacks for the shapes owned by this chain will be sent to. Care should be taken with any Object assigned as a callback target that isn't a Object as this assignment will not in itself keep the object alive and can be garbage collected. To avoid this, you should have at least a single reference to the object in your code. To remove the object assigned here, set the callback target to NULL. This includes the following events: A PhysicsEvents.ContactFilterEvent with call PhysicsCallbacks.IContactFilterCallback. A PhysicsEvents.PreSolveEvent with call PhysicsCallbacks.IPreSolveCallback. A PhysicsEvents.TriggerBeginEvent with call PhysicsCallbacks.ITriggerCallback. A PhysicsEvents.TriggerEndEvent with call PhysicsCallbacks.ITriggerCallback. A PhysicsEvents.ContactBeginEvent with call PhysicsCallbacks.IContactCallback. A PhysicsEvents.ContactEndEvent with call PhysicsCallbacks.IContactCallback.
Read time 2 minutesLast updated 7 days ago

Definition

  • Type: Property
  • Namespace: Unity.U2D.Physics
  • Assembly: UnityEngine.PhysicsCore2DModule
public object callbackTarget { get; set; }