Game.Prefabs.TrafficSignType
Assembly: Assembly-CSharp
Namespace: Game.Prefabs
Type: public enum
Base: System.Enum
Summary:
Defines the set of traffic sign types used by the game for road/traffic logic, rendering, and traffic rules. These values are used by prefabs, placement tools, AI routing/behaviour, and UI to represent different regulatory and informational signs. The final member Count
is a sentinel value representing the number of defined sign types.
Fields
-
None
Represents no sign / default state (no traffic sign assigned). -
Stop
Stop sign: instructs vehicles to come to a full stop at an intersection. -
Yield
Yield sign: vehicles should slow and give way to other traffic as appropriate. -
NoTurnLeft
Prohibits left turns at an intersection or junction. -
NoTurnRight
Prohibits right turns at an intersection or junction. -
NoUTurnLeft
Prohibits U-turns originating from the left side (used to express directional U-turn restrictions). -
NoUTurnRight
Prohibits U-turns originating from the right side. -
DoNotEnter
Do not enter sign: prevents traffic from entering a road/area (one-way opposite direction or restricted access). -
Motorway
Indicates motorway/highway rules (e.g., motorway-only policies or signage). -
Oneway
One-way road sign: indicates traffic may only flow in a single direction. -
SpeedLimit
Speed limit sign: enforces or displays a maximum speed for the road segment. Numerical value typically stored elsewhere (this enum only denotes the presence/type). -
Parking
Parking sign: indicates permitted parking areas or parking-related regulations. -
Street
Generic street sign or locality/information sign type used for streets. -
BusOnly
Bus-only sign: lane or road restricted to buses. -
TaxiOnly
Taxi-only sign: lane or road restricted to taxis. -
RoundaboutCounterclockwise
Roundabout sign oriented for counterclockwise traffic flow. -
RoundaboutClockwise
Roundabout sign oriented for clockwise traffic flow. -
MoveableBridge
Sign indicating a movable bridge (drawbridge) where special behavior/controls may apply. -
Count
Sentinel value representing the total number of defined sign types (useful for iteration or validation).
Properties
- This enum does not declare properties. Its values are accessed directly as enum members.
Constructors
public TrafficSignType()
Enums are value types and have an implicit default constructor. You do not create enum instances via constructors; use the defined members (for example,TrafficSignType.Stop
).
Methods
- This enum does not declare instance methods. Standard System.Enum/static utility methods (e.g., ToString, Parse, IsDefined) are available from the base type.
Usage Example
// Assigning a sign type to a variable or a component field
TrafficSignType sign = TrafficSignType.Stop;
// Using in a switch to apply behavior
switch (sign)
{
case TrafficSignType.Stop:
// apply stop sign logic (e.g., set stop requirement on approaching lanes)
break;
case TrafficSignType.SpeedLimit:
// read associated speed value and apply speed rule
break;
case TrafficSignType.None:
default:
// no sign behaviour
break;
}
// Example: storing sign type in a prefab/property
public class RoadSignComponent : MonoBehaviour
{
public TrafficSignType signType = TrafficSignType.None;
void ApplySign()
{
// Example logic that reacts to the chosen sign type
if (signType == TrafficSignType.BusOnly)
{
// restrict lane to buses in traffic management system
}
}
}