Game.Prefabs.TaxiwayPrefab
Assembly:
Assembly-CSharp (runtime game assembly)
Namespace:
Game.Prefabs
Type:
public class TaxiwayPrefab : NetGeometryPrefab
Base:
NetGeometryPrefab
Summary:
Prefab class used to define taxiway-related net geometry for airports (taxiways, runways, airspace). Exposes configuration that is serialized on the prefab (speed limit and boolean flags) and controls which ECS components are added to prefab/archetype entities. The prefab registers TaxiwayData for all prefab instances and, depending on the archetype components present, adds UpdateFrame and visual/logic components for edges, nodes, or net composition. This class is intended for modders creating or inspecting net prefabs for airports in Cities: Skylines 2.
Fields
-
public float m_SpeedLimit = 100f
Speed limit applied to this taxiway prefab (units as used by the game). Default value is 100f. Modders can adjust this on the prefab to control vehicle speed on taxiways/runways. -
public bool m_Taxiway
Flag indicating this prefab represents a taxiway. Used to mark/identify behavior at runtime or to select logic/visuals appropriate for taxiways. -
public bool m_Runway
Flag indicating this prefab represents a runway. Used similarly to m_Taxiway to differentiate behavior and visuals. -
public bool m_Airspace
Flag indicating this prefab is part of aircraft airspace (e.g. zones above runway/taxiway). Useful for systems that need to know whether the net belongs to airspace operations.
Properties
- This class does not declare explicit properties.
Constructors
public TaxiwayPrefab()
Implicit default constructor (no explicit implementation in source). Instances are typically created by Unity when the prefab/component is instantiated in the scene or by the game's prefab loading systems.
Methods
public override void GetPrefabComponents(HashSet<ComponentType> components)
Adds components required for the prefab itself. Implementation:- Calls base.GetPrefabComponents(components).
- Adds ComponentType.ReadWrite
() so every prefab instance includes TaxiwayData.
Use: ensures TaxiwayData is available at entity creation.
public override void GetArchetypeComponents(HashSet<ComponentType> components)
Adds archetype components based on what the archetype already contains. Implementation behavior:- Calls base.GetArchetypeComponents(components).
- If the archetype contains Edge, adds:
- UpdateFrame
- EdgeColor
- Taxiway
- Else if the archetype contains Node, adds:
- UpdateFrame
- NodeColor
- Taxiway
- Else if the archetype contains NetCompositionData, adds:
- TaxiwayComposition
Use: when the prefab is translated into ECS entities/archetypes, this method ensures the correct set of components are present for edges, nodes, or composition entities so the taxiway logic and rendering systems work properly.
Additional notes:
- The method expects and uses ComponentType.ReadWrite
Usage Example
// Example: querying which components would be added for an edge archetype
var components = new HashSet<ComponentType>
{
ComponentType.ReadWrite<Edge>()
};
var taxiwayPrefab = new TaxiwayPrefab
{
m_SpeedLimit = 90f,
m_Taxiway = true,
m_Runway = false,
m_Airspace = false
};
taxiwayPrefab.GetPrefabComponents(components);
taxiwayPrefab.GetArchetypeComponents(components);
// After calling GetArchetypeComponents, 'components' will include:
// - ComponentType.ReadWrite<TaxiwayData>()
// - ComponentType.ReadWrite<UpdateFrame>()
// - ComponentType.ReadWrite<EdgeColor>()
// - ComponentType.ReadWrite<Taxiway>()
{{Notes for modders: When adding or modifying airport-related nets, set m_Taxiway/m_Runway/m_Airspace appropriately and adjust m_SpeedLimit to influence vehicle/aircraft movement. Ensure Entity component definitions (TaxiwayData, Taxiway, TaxiwayComposition, etc.) are present in your mod if you extend behavior.}}