文档

Unity Engine

Unity Engine

CreateSnapshot(Allocator)

Capture the current simulation state of this world into a PhysicsWorld.Snapshot.
阅读时间1 分钟最后更新于 1 个月前

Definition

  • Type: Method
  • Namespace: Unity.U2D.Physics
  • Assembly: UnityEngine.PhysicsCore2DModule
public PhysicsWorld.Snapshot CreateSnapshot(Allocator allocator = Allocator.Persistent)

Parameters

allocator

The allocator for the snapshot memory. This can only be Allocator.Temp, Allocator.TempJob or Allocator.Persistent.

Returns

Type

Description

SnapshotA snapshot of the world that must be disposed of after use. The snapshot is not created if the world or allocator is invalid.