ドキュメント

Unity Engine

Unity Engine

SetBatchForce(ReadOnlySpan<BatchForce>)

Apply a force for a batch of PhysicsBody using a span of PhysicsBody.BatchForce. If invalid values are passed to the batch, they will simply be ignored. For best performance, the bodies contained in the batch should all be part of the same PhysicsWorld. If the bodies in the batch are not contained in the same PhysicsWorld, the batch should be sorted by the PhysicsWorld the bodies are contained within.
読み終わるまでの所要時間 1 分最終更新 1ヶ月前

Definition

  • Type: Method
  • Namespace: Unity.U2D.Physics
  • Assembly: UnityEngine.PhysicsCore2DModule
public static int SetBatchForce(ReadOnlySpan<PhysicsBody.BatchForce> batch)

Parameters

The batch of bodies and values to set.

Returns

Type

Description

intThe number of bodies that were ignored (not applied because the body was invalid). A single warning is logged when any are ignored.