Game.Prefabs.NetPieceLayerMask
Assembly: Assembly-CSharp (game/mod assembly)
Namespace: Game.Prefabs
Type: enum (with [Flags] attribute)
Base: System.Enum (underlying type: System.Int32)
Summary:
NetPieceLayerMask is a bitmask enum used to identify one or more mesh "layers" of a network piece (NetPiece) prefab. Each named value represents a distinct geometric or visual layer (for example surface geometry, underside, top details or vertical sides). Because it is marked with [Flags], values can be combined to select multiple layers for rendering, collision checks, baking, or editor operations.
Fields
-
Surface = 1
Represents the main, visible driving or walking surface geometry of the net piece. Use this flag to target the primary top-facing mesh. -
Bottom = 2
Represents underside geometry (the bottom faces of the net piece). Useful when you need to process or render parts that are normally hidden beneath the surface. -
Top = 4
Represents upper-detail geometry placed above the surface (e.g., rails, curbs, decorative trim). Use when you need only top detail layers. -
Side = 8
Represents vertical side geometry (faces along the edges/sides of the piece). Useful for operations affecting side meshes such as road edges, retaining walls or facades.
Properties
- None
Constructors
- None (enum types do not define constructors)
Methods
- None
Usage Example
// Combine layers
NetPieceLayerMask mask = NetPieceLayerMask.Surface | NetPieceLayerMask.Side;
// Check whether a specific layer is included
bool hasSide = (mask & NetPieceLayerMask.Side) != 0;
// or
bool hasTop = mask.HasFlag(NetPieceLayerMask.Top);
// Add or remove a layer
mask |= NetPieceLayerMask.Top; // add Top
mask &= ~NetPieceLayerMask.Bottom; // remove Bottom
// Get integer value for bitwise operations or storage
int rawValue = (int)mask;