Game.Prefabs.RouteModifierInfo
Assembly: Assembly-CSharp
Namespace: Game.Prefabs
Type: class
Base: System.Object
Summary:
RouteModifierInfo is a simple, serializable data container used by the game's routing/prefab system to describe a single modifier applied along a route. It stores what kind of modifier it is, how the modifier value is interpreted, and the 1D range over which the modifier applies. Instances of this class are typically embedded in route-related prefabs or data assets and are read by game systems at runtime. The class is marked with [Serializable] so it can be serialized by Unity/game asset pipelines.
Fields
-
public RouteModifierType m_Type
Describes which route property this modifier affects. The actual values are declared in the RouteModifierType enum (for example: different traffic or lane attributes). Check the RouteModifierType enum in Game.Routes for concrete options. -
public ModifierValueMode m_Mode
Determines how the modifier's value should be interpreted/applied (for example absolute vs. relative application, or additive/multiplicative semantics). See the ModifierValueMode enum for available modes and their semantics. -
public Bounds1 m_Range
A 1-dimensional bounds object (from Colossal.Mathematics) that defines the interval along the route where this modifier applies. Bounds1 typically contains a minimum and maximum (float) and is used to indicate start/end positions along a route segment or normalized range (depending on how the containing system interprets it).
Notes: - All fields are public and intended to be serialized and edited in prefabs or editor tooling. - The class has no behavior (methods) itself; it is a plain data holder consumed by route-processing systems.
Properties
- This class exposes no properties; it uses public fields for serialization and simple data access.
Constructors
public RouteModifierInfo()
Implicit default constructor. Default-initialized values depend on the underlying types:- enum fields default to the enum's zero value.
Bounds1
will be default-constructed (check Colossal.Mathematics.Bounds1 for its default min/max).
Methods
- This class does not declare any methods. It is purely a data container.
Usage Example
// Creating and populating a RouteModifierInfo to include in a prefab or route definition
var modifier = new RouteModifierInfo
{
m_Type = RouteModifierType.SomeModifier, // use an actual enum value from Game.Routes
m_Mode = ModifierValueMode.Additive, // use appropriate mode from ModifierValueMode
m_Range = new Bounds1(0.25f, 0.75f) // apply from 25% to 75% along the route (interpretation depends on consumer)
};
// Example: add to a list of modifiers on a hypothetical route prefab
myRoutePrefab.Modifiers.Add(modifier);
Additional notes for modders: - Inspect the RouteModifierType and ModifierValueMode enums in the Game.Routes namespace to understand supported modifier kinds and how to provide values. - Verify how Bounds1 is interpreted by the specific route-processing system you are working with (some systems expect normalized [0..1], others might use absolute distances). - Because fields are public and class is [Serializable], this type is suitable for serialization in prefab assets and for editing by external tools or the in-game editor.