기술 자료

Unity Engine

Unity Engine

SetCallbackTarget(ReadOnlySpan<PhysicsJoint>, object)

Set the same Object that event callbacks will be sent to on a batch of joints. Each joint is assigned the callback target as PhysicsJoint.callbackTarget would, and setting it to NULL removes it.
읽는 시간 1분최근 업데이트: 12일 전

Definition

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

SetCallbackTarget(ReadOnlySpan<PhysicsJoint>, Object)

public static int SetCallbackTarget(ReadOnlySpan<PhysicsJoint> joints, object callbackTarget)

Parameters

The joints to set the callback target on.

callbackTarget

The callback target to set on every joint, or NULL to remove it.

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

This is faster than setting PhysicsJoint.callbackTarget on each joint.