represents a raw bitmask rather than a set of named layers, apply PhysicsMask.ShowAsPhysicsMaskAttribute so Unity displays it as bit values in the Inspector window.
// Get the physics mask for the "Car" layer, then get another mask for the// layers the object should collide with.using UnityEngine;using Unity.U2D.Physics;public class PhysicsMaskExample : MonoBehaviour{ void Start() { PhysicsMask objectLayer = PhysicsLayers.GetLayerMask("Car"); PhysicsMask contactLayer = PhysicsLayers.GetLayerMask("Walls"); PhysicsShape.ContactFilter myContactFilter = new PhysicsShape.ContactFilter { categories = objectLayer, contacts = contactLayer }; }}
Gets an enumerable group of bits that are currently reset (0). The bits are returned in ascending bit-index order. This uses PhysicsMask.ResetBitIterator.
Convert the lower 32-bits of the 64-bit mask to the 32-bit LayerMask. A LayerMask is only 32-bits wide so the upper 32-bits of the PhysicsMask will be ignored.
When applied to a field/property of type PhysicsMask, the field/property drawer will not be display it as PhysicsLayers. Instead, the field/property will be displayed as bit numbers only i.e. a raw 64-bit mask allowing each bit to be (de)selected. This is only used when physics layers are active (see _usePhysicsLayers).