Game.Prefabs.SubMeshFlags
Assembly: Assembly-CSharp
Namespace: Game.Prefabs
Type: public enum SubMeshFlags : uint
Base: System.Enum (underlying type: System.UInt32)
Summary:
SubMeshFlags is a bitmask enum (marked with [Flags]) used by prefab submeshes to indicate when or how a particular submesh should be used or rendered. Each flag represents a condition, variant or rendering hint (age group, occupancy, stacking position, traffic handedness, partial variants, etc.). Flags can be combined with bitwise operations to describe composite requirements for selecting or drawing submeshes.
Fields
-
RequireSafe = 1u
Indicates this submesh is intended for the "safe" variant (a prefab-specific state/variant labeled "safe"). -
RequireLevelCrossing = 2u
Indicates the submesh is used when a level crossing (rail/road crossing) condition applies. -
RequireChild = 4u
Use this submesh for child-age variants. -
RequireTeen = 8u
Use this submesh for teen-age variants. -
RequireAdult = 0x10u
Use this submesh for adult-age variants. -
RequireElderly = 0x20u
Use this submesh for elderly-age variants. -
RequireDead = 0x40u
Use this submesh to represent a "dead" variant (e.g., destroyed/dying object). -
RequireStump = 0x80u
Use this submesh to represent a stump variant (typically for trees after removal). -
RequireEmpty = 0x100u
Use this submesh when the container/slot is empty. -
RequireFull = 0x200u
Use this submesh when the container/slot is full. -
RequireEditor = 0x400u
Use this submesh in editor mode (placement/asset editor) only. -
RequireClear = 0x800u
Indicates the submesh is for a "clear" state (e.g., cleared terrain or cleared object variant). -
RequireTrack = 0x1000u
Indicates this submesh is associated with track/rail rendering. -
IsStackStart = 0x2000u
Marks the submesh as the start element in a stacked sequence. -
IsStackMiddle = 0x4000u
Marks the submesh as a middle element in a stacked sequence. -
IsStackEnd = 0x8000u
Marks the submesh as the end element in a stacked sequence. -
RequireLeftHandTraffic = 0x10000u
Use this submesh when left-hand traffic rules apply. -
RequireRightHandTraffic = 0x20000u
Use this submesh when right-hand traffic rules apply. -
DefaultMissingMesh = 0x40000u
Indicates this submesh is the default placeholder to use when a required mesh is missing. -
RequirePartial1 = 0x80000u
Indicates the first partial variant (used for multiple-part or partial meshes). -
RequirePartial2 = 0x100000u
Indicates the second partial variant. -
HasTransform = 0x200000u
Indicates the submesh has its own transform (i.e., non-default local transform to be applied). -
RequireForward = 0x400000u
Use this submesh for forward-facing variants (directional). -
RequireBackward = 0x800000u
Use this submesh for backward-facing variants (directional). -
OutlineOnly = 0x1000000u
Indicates the submesh should be rendered as outline-only (used for selection/preview outlines or stylized rendering).
Properties
- None (enum type — no properties).
Constructors
- None (enum type — handled by CLR).
Methods
- None (enum type — no methods defined in source).
Usage Example
// Combine flags to indicate a submesh that applies to adult variant and right-hand traffic
SubMeshFlags flags = SubMeshFlags.RequireAdult | SubMeshFlags.RequireRightHandTraffic;
// Test for a single flag
bool isAdult = (flags & SubMeshFlags.RequireAdult) != 0;
// Test for multiple flags (both must be present)
bool isAdultRightHand = (flags & (SubMeshFlags.RequireAdult | SubMeshFlags.RequireRightHandTraffic))
== (SubMeshFlags.RequireAdult | SubMeshFlags.RequireRightHandTraffic);
// Typical use (pseudo-code): choose submesh whose flags match the current state
SubMeshFlags currentState = SubMeshFlags.RequireAdult | SubMeshFlags.RequireRightHandTraffic;
foreach (var submesh in prefab.SubMeshes)
{
if ((submesh.Flags & currentState) == submesh.Flags)
{
// use this submesh variant
}
}