Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


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.
Read time 1 minuteLast updated 7 days ago

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

intThe 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.