SyncShapes
Refresh every proxy from its shape, updating each proxy AABB and categories to match the live shape. This only applies to a space bound to a world. A proxy whose shape has been destroyed since it was added is skipped and reported with a single warning.
Read time 1 minuteLast updated 13 days ago
Definition
- Type: Method
- Namespace: Unity.U2D.Physics
- Assembly: UnityEngine.PhysicsCore2DModule
SyncShapes()
Refresh every proxy from its shape, updating each proxy AABB and categories to match the live shape. This only applies to a space bound to a world. A proxy whose shape has been destroyed since it was added is skipped and reported with a single warning.
public int SyncShapes()
Returns
Type | Description |
|---|---|
| int | The number of proxies that were synced. |
Remarks
See PhysicsSpace.Create and _sourceWorld.
SyncShapes(ReadOnlySpan<ProxyHandle>)
Refresh the specified proxies from their shapes, updating each proxy AABB and categories to match the live shape. This only applies to a space bound to a world. An invalid proxy handle, or a proxy whose shape has been destroyed, is skipped and reported with a single warning.
public int SyncShapes(ReadOnlySpan<PhysicsSpace.ProxyHandle> proxyHandles)
Parameters
The proxies to sync.
Returns
Type | Description |
|---|---|
| int | The number of proxies that were synced. |
Remarks
See PhysicsSpace.Create and _sourceWorld.
SyncShapes(ProxyHandle)
Refresh a single proxy from its shape, updating the proxy AABB and categories to match the live shape. This only applies to a space bound to a world. The proxy is skipped if its handle is invalid or its shape has been destroyed.
public int SyncShapes(PhysicsSpace.ProxyHandle proxyHandle)
Parameters
The proxy to sync.
Returns
Type | Description |
|---|---|
| int | The number of proxies that were synced (0 or 1). |
Remarks
See PhysicsSpace.Create and _sourceWorld.