Skip to content

Game.Prefabs.MeshFlags

Assembly: Game (types from the game's code; in compiled builds this is often in Assembly-CSharp)
Namespace: Game.Prefabs

Type: enum (with [Flags] attribute)

Base: System.Enum (underlying type: System.UInt32)

Summary:
MeshFlags is a flags-style enumeration used by prefab mesh definitions to describe rendering and behavior hints for meshes (decals, tiling, stacking, LOD/impostor usage, animation/skeleton/character markers, etc.). The [Flags] attribute indicates values are intended to be combined with bitwise operations.


Fields

  • Decal = 0x1 (1)
    Marks the mesh as a decal — typically projected onto surfaces or used for detail overlays.

  • StackX = 0x2 (2)
    Indicates the mesh supports/uses stacking or ordering along the X axis (used for tiled or stacked variations).

  • StackY = 0x4 (4)
    Indicates stacking/ordering support along the Y axis.

  • StackZ = 0x8 (8)
    Indicates stacking/ordering support along the Z axis.

  • Impostor = 0x10 (16)
    Marks the mesh as an impostor candidate (simplified billboard/LOD representation used at distance).

  • Tiling = 0x20 (32)
    Indicates the mesh supports tiling (texture or geometry tiling for repeating surfaces).

  • Invert = 0x40 (64)
    Suggests the mesh should be inverted in some way (commonly used to flip normals/UVs or mirror geometry depending on engine usage).

  • Base = 0x80 (128)
    Marks the mesh as a base/main part (used to differentiate base geometry from overlays or variations).

  • MinBounds = 0x100 (256)
    Requests or indicates use of minimal bounding volume/box optimizations for the mesh.

  • Default = 0x200 (512)
    A default marker value; semantics depend on how the game treats a "default" mesh flag for prefabs.

  • Animated = 0x1000 (4096)
    Indicates the mesh is animated (has vertex animation or requires animation handling).

  • Skeleton = 0x2000 (8192)
    Marks that the mesh uses a skeleton (skinned mesh with bones) and requires skinning support.

  • Character = 0x4000 (16384)
    Denotes the mesh represents a character or character-like entity (often affects LOD, animation, or culling rules).

Properties

  • None (this type is an enum; it exposes no properties)

Constructors

  • Enums do not expose public constructors in C#. The runtime provides an implicit default value (zero) and values are created by assigning enum members or by casting from the underlying integral type:
  • Example: MeshFlags f = MeshFlags.Decal;
  • Casting from underlying integer: MeshFlags f = (MeshFlags)0x10u;

Methods

  • The enum itself defines no methods. Standard enum/flag operations apply:
  • Combine flags with bitwise OR: flags = MeshFlags.Decal | MeshFlags.Tiling;
  • Test flags with bitwise AND: (flags & MeshFlags.Decal) != 0
  • Use Enum.HasFlag: flags.HasFlag(MeshFlags.Decal) (note: HasFlag is slower than bitwise tests)
  • Convert to/from numeric types via casts.

Usage Example

// Combine flags
MeshFlags flags = MeshFlags.Decal | MeshFlags.Tiling;

// Test flags (bitwise)
if ((flags & MeshFlags.Decal) != 0)
{
    // handle decal-specific setup
}

// Test flags (HasFlag)
if (flags.HasFlag(MeshFlags.Tiling))
{
    // apply tiling behavior
}

// Casting from a raw uint (e.g., loaded from file/data)
uint raw = 0x1001u; // Decal + Animated (0x1 | 0x1000)
MeshFlags fromRaw = (MeshFlags)raw;