SetBatchProxyCategories(ReadOnlySpan<ProxyHandle>, ReadOnlySpan<PhysicsMask>)
Set a batch of proxy categories, where the categories at each index are set on the corresponding proxy at the same index. The two spans must be the same length. This can be an expensive operation as all ancestors need to be recalculated. Any invalid proxy handle in the batch is skipped and reported with a single warning.
阅读时间1 分钟最后更新于 1 个月前
Definition
- Type: Method
- Namespace: Unity.U2D.Physics
- Assembly: UnityEngine.PhysicsCore2DModule
public int SetBatchProxyCategories(ReadOnlySpan<PhysicsSpace.ProxyHandle> proxyHandles, ReadOnlySpan<PhysicsMask> categories)
Parameters
The proxies to set.
The categories as a physics mask to set on each corresponding proxy.
Returns
Type | Description |
|---|---|
| int | The number of proxies that were ignored (not set because the proxy handle was invalid). If the space is invalid or the spans are different lengths, nothing is set and every proxy is counted as ignored. |