文档

Unity Engine

Unity Engine

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.
阅读时间1 分钟最后更新于 23 天前

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

intThe number of proxies that were synced.

Remarks

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

intThe number of proxies that were synced.

Remarks

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

proxyHandle

The proxy to sync.

Returns

Type

Description

intThe number of proxies that were synced (0 or 1).

Remarks