Struct PhysicsLayerMask
Represents an include mask for physics layer queries and filters.
[MemoryPackable(GenerateType.Object)]
public struct PhysicsLayerMask : IEquatable<PhysicsLayerMask>, IMemoryPackable<PhysicsLayerMask>, IMemoryPackFormatterRegister
- Implements
-
IMemoryPackable<PhysicsLayerMask>IMemoryPackFormatterRegister
- Inherited Members
Remarks
MemoryPack GenerateType: unmanaged
int _bits
Constructors
PhysicsLayerMask(int)
Creates an include mask from its raw bit field.
public PhysicsLayerMask(int bits)
Parameters
bitsint
Properties
All
Gets a mask that includes every physics layer.
[JsonIgnore]
[MemoryPackIgnore]
public static PhysicsLayerMask All { get; }
Property Value
Bits
Gets the raw include-mask bits.
[JsonIgnore]
[MemoryPackIgnore]
public readonly int Bits { get; }
Property Value
None
Gets a mask that includes no physics layers.
[JsonIgnore]
[MemoryPackIgnore]
public static PhysicsLayerMask None { get; }
Property Value
Methods
Equals(PhysicsLayerMask)
public readonly bool Equals(PhysicsLayerMask other)
Parameters
otherPhysicsLayerMask
Returns
Equals(object?)
public override readonly bool Equals(object? obj)
Parameters
objobject
Returns
Excluding(params PhysicsLayer[])
Creates an include mask containing every layer except those specified.
public static PhysicsLayerMask Excluding(params PhysicsLayer[] excludedLayers)
Parameters
excludedLayersPhysicsLayer[]
Returns
FromLayer(PhysicsLayer)
Creates an include mask containing one layer.
public static PhysicsLayerMask FromLayer(PhysicsLayer layer)
Parameters
layerPhysicsLayer
Returns
FromLayer(int)
Creates an include mask containing one layer index.
public static PhysicsLayerMask FromLayer(int layerIndex)
Parameters
layerIndexint
Returns
FromLayers(params PhysicsLayer[])
Creates an include mask containing the specified layers.
public static PhysicsLayerMask FromLayers(params PhysicsLayer[] layers)
Parameters
layersPhysicsLayer[]
Returns
GetHashCode()
public override readonly int GetHashCode()
Returns
Includes(PhysicsLayer)
Determines whether this mask includes the specified layer.
public readonly bool Includes(PhysicsLayer layer)
Parameters
layerPhysicsLayer
Returns
Includes(int)
Determines whether this mask includes the specified layer index.
public readonly bool Includes(int layerIndex)
Parameters
layerIndexint
Returns
ToString()
public override readonly string ToString()
Returns
Operators
operator ==(PhysicsLayerMask, PhysicsLayerMask)
Determines whether two layer masks contain the same bits.
public static bool operator ==(PhysicsLayerMask left, PhysicsLayerMask right)
Parameters
leftPhysicsLayerMaskrightPhysicsLayerMask
Returns
operator !=(PhysicsLayerMask, PhysicsLayerMask)
Determines whether two layer masks contain different bits.
public static bool operator !=(PhysicsLayerMask left, PhysicsLayerMask right)
Parameters
leftPhysicsLayerMaskrightPhysicsLayerMask