Skip to content

Game.Prefabs.UITransportSummaryItem

Assembly:
Assembly-CSharp (game runtime assembly where most game classes live)

Namespace:
Game.Prefabs

Type:
public class (marked [Serializable])

Base:
UITransportItem

Summary:
UITransportSummaryItem is a small serializable UI component class used by the game's transport UI. It extends UITransportItem and exposes which transport statistic to display (m_Statistic) and whether transport lines should be shown for the summary entry (m_ShowLines). Because it is marked [Serializable] and uses plain fields, instances are suitable for Unity serialization (e.g., stored on prefabs or scene objects).


Fields

  • public StatisticType m_Statistic
    {{ This field selects which transport statistic this summary entry represents. StatisticType is typically an enum that identifies different transport-related metrics (for example passenger counts, ridership, income, etc.). UI code reads this field to determine which data to fetch and display. }}

  • public bool m_ShowLines = true
    {{ When true (the default), the UI element will include transport line visuals (e.g., colored route lines or indicators) along with the statistic. When false, the summary entry will omit line-related visuals and show only numeric/statistical information. }}

Properties

  • None declared on this class.
    {{ Any runtime or editor-facing behavior is controlled via the public fields above and behavior inherited from UITransportItem. Check the base class for exposed properties and methods you can use/override. }}

Constructors

  • public UITransportSummaryItem()
    {{ No explicit constructor is defined in the source file; the default parameterless constructor is used. Initialization is intended to rely on Unity's serialization (field defaults) and any initialization in the base class UITransportItem. }}

Methods

  • None declared in this class.
    {{ The class does not add custom methods; functionality (rendering, event handling, data binding) is provided by UITransportItem or other UI systems. Inspect the base class and surrounding UI framework to see how m_Statistic and m_ShowLines are consumed. }}

Usage Example

// Example: configure a UITransportSummaryItem (e.g., during prefab setup or at runtime)
var summaryItem = new UITransportSummaryItem();
summaryItem.m_Statistic = StatisticType.Ridership; // set desired statistic
summaryItem.m_ShowLines = true; // show transport lines alongside the statistic

// In practice this object is usually attached to a Unity prefab and configured in the editor.
// The UI system will read m_Statistic to populate the displayed value, and m_ShowLines to
// determine whether to render associated route visuals.

{{ Tips: - Because the class is [Serializable] and uses public fields, prefer configuring instances on prefabs in the editor rather than instantiating and configuring purely by code unless necessary. - To modify behavior, extend UITransportItem or override relevant hooks in the UI framework rather than adding logic directly to this data-holder type. - Look up the StatisticType enum and UITransportItem implementation to understand what statistic values are expected and how the UI consumes them. }}