Game.Prefabs.EffectConditionFlags
Assembly: Assembly-CSharp
Namespace: Game.Prefabs
Type: enum
Base: System.Enum
Summary:
An enum decorated with [Flags] representing condition flags used by effect prefabs (visual/audio effects) to indicate when an effect should play. Flags encode various runtime states (e.g., OnFire, Parked, Night) so effect systems can test combinations of conditions. The enum values are bit flags and can be combined with bitwise operations. The sentinel Last duplicates the highest-value flag (MoveableBridgeWorking) and is typically used as a marker for the last valid flag.
Fields
-
None = 0
Represents no condition; the effect is not restricted by any condition. -
Emergency = 1
Indicates an emergency state (e.g., emergency vehicle responding). -
Parked = 2
Indicates a parked state (vehicle is parked). -
Operational = 4
Indicates the operational/active state. -
OnFire = 8
Indicates the object or area is on fire. -
Extinguishing = 0x10
Indicates an extinguishing action is in progress. -
TakingOff = 0x20
Represents a takeoff state (aircraft). -
Landing = 0x40
Represents a landing state (aircraft). -
Flying = 0x80
Represents a flying state (aircraft). -
Stopped = 0x100
Indicates a stopped state. -
Processing = 0x200
Indicates processing is occurring (e.g., production buildings). -
Boarding = 0x400
Indicates boarding is in progress (vehicles/stations). -
Disaster = 0x800
Indicates a disaster state in the area. -
Occurring = 0x1000
Indicates an event/condition is occurring. -
Night = 0x2000
Indicates nighttime (used for night-only effects). -
Cold = 0x4000
Indicates cold weather or related condition. -
LightsOff = 0x8000
Indicates lights are turned off. -
MainLights = 0x10000
Indicates main lights are active. -
ExtraLights = 0x20000
Indicates extra lights (auxiliary lighting) are active. -
WarningLights = 0x40000
Indicates warning lights are active. -
WorkLights = 0x80000
Indicates work lights are active. -
Spillway = 0x100000
Indicates spillway-related condition (e.g., dam water overflow). -
Collapsing = 0x200000
Indicates a collapsing/failing state. -
MoveableBridgeWorking = 0x400000
Indicates a movable bridge is in its working/active state. -
Last = 0x400000
Sentinel representing the last flag value; duplicates MoveableBridgeWorking.
Properties
- (none specific)
This enum does not define properties. Use bitwise operations or Enum helper methods to inspect values.
Constructors
- (none)
Enums in C# do not have explicit constructors; values are assigned as constants.
Methods
- (none specific)
Standard System.Enum methods are available (ToString, HasFlag, etc.). For performance in tight loops, prefer bitwise checks over Enum.HasFlag.
Usage Example
// Combine flags
EffectConditionFlags flags = EffectConditionFlags.OnFire | EffectConditionFlags.WarningLights;
// Check a flag (recommended: bitwise check for performance)
if ((flags & EffectConditionFlags.OnFire) != 0)
{
// play fire-related effect
}
// Remove a flag
flags &= ~EffectConditionFlags.WarningLights;
// Using HasFlag (works, but slower)
if (flags.HasFlag(EffectConditionFlags.OnFire))
{
// ...
}
Additional notes: - Because this is a [Flags] enum, multiple flags are intended to be combined using bitwise OR. - The highest defined bit is 0x400000 (bit 22). If new flags are added, ensure they use unused bit positions to avoid collisions. - The duplicate Last value is commonly used as a sentinel/end marker; treat it as equivalent to MoveableBridgeWorking rather than a separate independent flag.