Class Constants.Layers.Index
Layer indices (0-31), for APIs that take a single layer such as
UnityEngine.GameObject.layer. The members of the enclosing class are
UnityEngine.LayerMask bit masks instead, for APIs that take a mask such as
Physics.Raycast: assigning a mask where an index is expected sets a
wildly out-of-range layer (mask 256 for layer 8), and shifting a mask again
(1 << mask) silently selects the wrong layer because C# masks the
shift count to 5 bits.
public static class Constants.Layers.Index
- Inheritance
-
Constants.Layers.Index
- Inherited Members
Remarks
A value is -1 when the layer is missing from the project's Tag Manager; callers must check before assigning. See Validate().
Fields
DefaultLayer
Index of the Default layer, or -1 if missing.
public static readonly int DefaultLayer
Field Value
Ground
Index of the Ground layer, or -1 if missing.
public static readonly int Ground
Field Value
IgnoreRaycast
Index of the Ignore Raycast layer, or -1 if missing.
public static readonly int IgnoreRaycast
Field Value
Player
Index of the Player layer, or -1 if missing.
public static readonly int Player