CreateSnapshot(Allocator)
Capture the current simulation state of this world into a PhysicsWorld.Snapshot.
Read time 1 minuteLast updated 12 days ago
Definition
- Type: Method
- Namespace: Unity.U2D.Physics
- Assembly: UnityEngine.PhysicsCore2DModule
public PhysicsWorld.Snapshot CreateSnapshot(Allocator allocator = Allocator.Persistent)
Parameters
The allocator for the snapshot memory. This can only be Allocator.Temp, Allocator.TempJob or Allocator.Persistent.
Returns
Type | Description |
|---|---|
| Snapshot | A snapshot of the world that must be disposed of after use. The snapshot is not created if the world or allocator is invalid. |