Game.Prefabs.LaneDirectionType
Assembly:
Namespace: Game.Prefabs
Type: public enum LaneDirectionType : short
Base: System.Enum (underlying type: System.Int16)
Summary:
Represents discrete lane direction categories used by the game's prefab/lane system. Each enum member maps to an angle in degrees (stored as a short) used by lane geometry, steering logic and rendering to describe the lane's direction/curvature. Negative or special values (e.g., None = -180) typically denote an unspecified or invalid direction.
Fields
-
None = -180
Indicates no direction or an unspecified/invalid direction. Often used as a sentinel value. -
Straight = 0
Represents a straight lane (0 degrees). -
Merge = 10
Represents a small-angled merge lane (about 10 degrees). Used for slight lane merges. -
Gentle = 45
Represents a gentle curve (~45 degrees). -
Square = 90
Represents a sharp/right-angle turn (~90 degrees). -
UTurn = 180
Represents a 180-degree reversal (U-turn).
Properties
This enum type declares no properties.
Constructors
Implicit default constructor
Enums in C# have an implicit parameterless constructor and each named value maps to the defined short constant. You can cast from underlying short values when needed.
Methods
This enum declares no custom methods. It inherits the standard System.Enum / System.ValueType methods such as ToString(), GetHashCode(), CompareTo(), HasFlag(), and methods for parsing/formatting.
Usage Example
// Assigning a direction to a lane variable
LaneDirectionType dir = LaneDirectionType.Gentle;
// Checking a value
if (dir == LaneDirectionType.Straight)
{
// handle straight lane
}
// Casting from a raw short value (e.g., read from data or network)
short raw = /* read value */;
if (Enum.IsDefined(typeof(LaneDirectionType), (short)raw))
{
LaneDirectionType parsed = (LaneDirectionType)raw;
// use parsed
}
else
{
LaneDirectionType parsed = LaneDirectionType.None; // fallback
}
{{ Additional notes: - Underlying type is short (System.Int16); be careful when interfacing with APIs that expect ints. - Values represent angles in degrees used by lane geometry and AI. Interpret negative/sentinel values accordingly. - When extending or mapping external data to this enum, always validate the raw value with Enum.IsDefined or custom checks to avoid invalid casts. }}