Scripting API
Scripting API
LayerMask
Record struct in Abyss.Core, from Abyss.Core.
Some of a project's 32 layers, a bit each: what a camera draws, and what physics and rays will meet. Made from the layers' numbers, as the game's code names them — LayerMask.Of(Layers.Player, Layers.Enemy).
public readonly record struct LayerMaskConstructors
LayerMask
public LayerMask(uint Bits)Some of a project's 32 layers, a bit each: what a camera draws, and what physics and rays will meet. Made from the layers' numbers, as the game's code names them — LayerMask.Of(Layers.Player, Layers.Enemy).
Parameters
Bits: A bit for each layer it has: bit 0 Default, bit 31 the last.
Properties
Bits
public uint Bits { get; init; }A bit for each layer it has: bit 0 Default, bit 31 the last.
Everything
public static LayerMask Everything { get; }Every layer.
Nothing
public static LayerMask Nothing { get; }No layer at all.
Methods
Of
public static LayerMask Of(params int[] layers)The mask of the layers numbered layers.
Parameters
layers
Exceptions
ArgumentOutOfRangeException: A number is not one of the 32.
Contains
public bool Contains(int layer)Whether it has the layer numbered layer.
Parameters
layer
Exceptions
ArgumentOutOfRangeException: The number is not one of the 32.
With
public LayerMask With(int layer)This and the layer numbered layer.
Parameters
layer
Without
public LayerMask Without(int layer)This but the layer numbered layer.
Parameters
layer
Operators
operator |
public static LayerMask operator |(LayerMask left, LayerMask right)The layers either has.
Parameters
leftright
operator &
public static LayerMask operator &(LayerMask left, LayerMask right)The layers both have.
Parameters
leftright
operator ~
public static LayerMask operator ~(LayerMask mask)The layers it has not.
Parameters
mask
