Class LayersMask
The objects layers selection mask (from layers and tags settings). Uses 1 bit per layer (up to 32 layers).
Inheritance
Implements
Namespace: FlaxEngine
Assembly: FlaxEngine.CSharp.dll
Syntax
[Unmanaged]
public sealed class LayersMask : ValueType, IComparable, IComparable<LayersMask>
Constructors
LayersMask(Int32)
Initializes a new instance of the LayersMask struct.
Declaration
public LayersMask(int mask)
Parameters
System.Int32
mask
The bit mask. |
LayersMask(UInt32)
Initializes a new instance of the LayersMask struct.
Declaration
public LayersMask(uint mask)
Parameters
System.UInt32
mask
The bit mask. |
Fields
Mask
The layers selection mask.
Declaration
public uint Mask
Field Value
System.UInt32
|
Properties
Default
The default LayersMask.
Declaration
public static LayersMask Default { get; }
Property Value
LayersMask
|
Methods
CompareTo(LayersMask)
CompareTo(Object)
Declaration
public int CompareTo(object obj)
Parameters
System.Object
obj
|
Returns
System.Int32
|
Equals(LayersMask)
Tests for equality between two objects.
Declaration
public bool Equals(LayersMask other)
Parameters
LayersMask
other
The other value to compare. |
Returns
System.Boolean
True if both values are equal, otherwise false. |
Equals(Object)
Declaration
public override bool Equals(object obj)
Parameters
System.Object
obj
|
Returns
System.Boolean
|
GetHashCode()
Declaration
public override int GetHashCode()
Returns
System.Int32
|
HasLayer(Int32)
Determines whether the specified layer index is set in the mask.
Declaration
public bool HasLayer(int layerIndex)
Parameters
System.Int32
layerIndex
Index of the layer (zero-based). |
Returns
System.Boolean
|
HasLayer(String)
Determines whether the specified layer is set in the mask.
Declaration
public bool HasLayer(string layerName)
Parameters
System.String
layerName
Name of the layer (from layers settings). |
Returns
System.Boolean
|
ToString()
Declaration
public override string ToString()
Returns
System.String
|
Operators
Addition(LayersMask, LayersMask)
Adds two masks.
Declaration
public static LayersMask operator +(LayersMask left, LayersMask right)
Parameters
LayersMask
left
The left mask. |
LayersMask
right
The right mask. |
Returns
LayersMask
The sum of the two masks. |
BitwiseAnd(LayersMask, LayersMask)
Performance bitwise AND of the masks.
Declaration
public static LayersMask operator &(LayersMask left, LayersMask right)
Parameters
LayersMask
left
The left mask. |
LayersMask
right
The right mask. |
Returns
LayersMask
The conjunction of the two masks. |
BitwiseOr(LayersMask, LayersMask)
Performance bitwise OR of the masks.
Declaration
public static LayersMask operator |(LayersMask left, LayersMask right)
Parameters
LayersMask
left
The left mask. |
LayersMask
right
The right mask. |
Returns
LayersMask
The sum of the two masks. |
Equality(LayersMask, LayersMask)
Tests for equality between two objects.
Declaration
public static bool operator ==(LayersMask left, LayersMask right)
Parameters
LayersMask
left
The first value to compare. |
LayersMask
right
The second value to compare. |
Returns
System.Boolean
|
ExclusiveOr(LayersMask, LayersMask)
Performance bitwise XOR of the masks.
Declaration
public static LayersMask operator ^(LayersMask left, LayersMask right)
Parameters
LayersMask
left
The left mask. |
LayersMask
right
The right mask. |
Returns
LayersMask
The difference of the two masks. |
Implicit(LayersMask to UInt32)
Performs an implicit conversion from LayersMask to System.UInt32.
Declaration
public static implicit operator uint (LayersMask mask)
Parameters
LayersMask
mask
The mask. |
Returns
System.UInt32
The mask value. |
Inequality(LayersMask, LayersMask)
Tests for inequality between two objects.
Declaration
public static bool operator !=(LayersMask left, LayersMask right)
Parameters
LayersMask
left
The first value to compare. |
LayersMask
right
The second value to compare. |
Returns
System.Boolean
|
OnesComplement(LayersMask)
Performance bitwise NOT of the mask.
Declaration
public static LayersMask operator ~(LayersMask left)
Parameters
LayersMask
left
The mask. |
Returns
LayersMask
The negated mask. |
Subtraction(LayersMask, LayersMask)
Removes one mask from another.
Declaration
public static LayersMask operator -(LayersMask left, LayersMask right)
Parameters
LayersMask
left
The left mask. |
LayersMask
right
The right mask. |
Returns
LayersMask
The left mask without right mask. |