Skip to content

Game.Prefabs.SecondaryLaneInfo2

Assembly: Assembly-CSharp.dll
Namespace: Game.Prefabs

Type: class

Base: System.Object

Summary:
Serializable helper class that describes additional/per-lane requirements for a secondary net lane prefab (references a NetLanePrefab and a set of boolean requirement flags). Primarily used to capture which additional behaviors or assets a secondary lane needs (stop, yield, pavement, continue) and to produce a bitmask of those requirements via GetFlags().


Fields

  • public NetLanePrefab m_Lane
    Reference to the lane prefab this entry applies to. May be null if not assigned. The type NetLanePrefab represents the lane definition (graphics/behavior) used by the network.

  • public bool m_RequireStop
    When true, this lane requires a "stop" requirement. Affects the resulting SecondaryNetLaneFlags bitmask returned by GetFlags().

  • public bool m_RequireYield
    When true, this lane requires a "yield" requirement. Contributes to the SecondaryNetLaneFlags bitmask.

  • public bool m_RequirePavement
    When true, this lane requires pavement (sidewalk/edge) related handling/visuals. Included in the flags returned by GetFlags().

  • public bool m_RequireContinue
    When true, this lane requires "continue" behavior (e.g., allowing traffic to continue). Included in the flags returned by GetFlags().

Properties

  • None (this class exposes public fields and a method; there are no C# properties declared).

Constructors

  • public SecondaryLaneInfo2()
    Default parameterless constructor (implicit if not declared). Creates an instance with m_Lane = null and all requirement booleans set to false. The class is marked [Serializable] so it can be serialized by Unity.

Methods

  • public SecondaryNetLaneFlags GetFlags()
    Builds and returns a SecondaryNetLaneFlags bitmask composed from the four boolean requirement fields. Internally it starts from zero and ORs in each of:
  • SecondaryNetLaneFlags.RequireStop if m_RequireStop is true
  • SecondaryNetLaneFlags.RequireYield if m_RequireYield is true
  • SecondaryNetLaneFlags.RequirePavement if m_RequirePavement is true
  • SecondaryNetLaneFlags.RequireContinue if m_RequireContinue is true

Returns a combined SecondaryNetLaneFlags value representing all active requirements for this lane.

Notes: - SecondaryNetLaneFlags is a flags enum (bitfield). Expected flag names observed in code: RequireStop, RequireYield, RequirePavement, RequireContinue. - This method is pure (no side effects) and cheap to call.

Usage Example

// Create and configure a secondary lane info entry
var info = new Game.Prefabs.SecondaryLaneInfo2();
info.m_Lane = someNetLanePrefab; // assign a NetLanePrefab reference
info.m_RequireStop = true;
info.m_RequireYield = false;
info.m_RequirePavement = true;
info.m_RequireContinue = false;

// Get combined flags
SecondaryNetLaneFlags flags = info.GetFlags();

// Check flags
bool needsStop = (flags & SecondaryNetLaneFlags.RequireStop) != 0;
bool needsPavement = (flags & SecondaryNetLaneFlags.RequirePavement) != 0;

{{ Additional info: - This class is designed for use within prefab/network configuration data for Cities: Skylines 2 mods.
- Because fields are public and the class is [Serializable], Unity's inspector and serialization systems can read/write instances as part of larger prefab assets.
- When extending or modifying behavior, prefer using GetFlags() to gather the flags rather than reading booleans individually, since other systems may expect the bitmask form. }}