Game.Prefabs.WaterLevelTargetType
Assembly: Assembly-CSharp
Namespace: Game.Prefabs
Type: public enum WaterLevelTargetType : byte
Base: System.Enum (underlying type: System.Byte)
Summary:
Enum used to indicate which water target type a given prefab or system should affect or respond to. It is marked [Serializable] so it can be serialized by Unity. Note that the members are not declared with the [Flags] attribute — the special All value uses byte.MaxValue (255) rather than being the bitwise OR of River and Sea.
Fields
-
None = 0
Represents no target; the default/empty value. -
River = 1
Represents river water-level targets. -
Sea = 2
Represents sea water-level targets. -
All = byte.MaxValue
Represents all targets. Because this equals 255 (byte.MaxValue) rather than River|Sea (which would be 3), code should treat All as a special-case value rather than relying on bitwise flag semantics.
Properties
- This enum type does not expose properties. Use the enum values directly in comparisons and switches.
Constructors
public WaterLevelTargetType()
Enums have no meaningful public constructors to initialize values in user code; values are assigned from the defined named members.
Methods
- No custom methods are defined on this enum. Standard System.Enum methods (ToString, HasFlag, etc.) are available; however, HasFlag can be misleading here because the enum is not decorated with [Flags] and All is not a true combination of the other values.
Usage Example
using Game.Prefabs;
void ApplyWaterLevel(WaterLevelTargetType target)
{
if (target == WaterLevelTargetType.None)
return;
// Treat All as a special-case
if (target == WaterLevelTargetType.All || target == WaterLevelTargetType.River)
{
// apply river-specific logic
}
if (target == WaterLevelTargetType.All || target == WaterLevelTargetType.Sea)
{
// apply sea-specific logic
}
}
// Example call
ApplyWaterLevel(WaterLevelTargetType.River);
Notes: - When checking for multiple types, do not assume bitwise combinations unless the enum is changed to use [Flags] and values are adjusted accordingly. - Because the enum is a byte, it’s compact for storage/serialization in game data.