Game.Prefabs.UITransportItem
Assembly: Assembly-CSharp (game code)
Namespace: Game.Prefabs
Type: class
Base: System.Object
Summary:
Serializable plain data container used by the UI to represent a transport-related unlockable entry. Holds a reference to the unlockable prefab, the transport type/category, and an icon identifier (string). Typically used to populate transport lists or menus in the UI.
Fields
-
public PrefabBase m_Unlockable
Reference to the unlockable prefab associated with this UI entry. This should point to a loaded PrefabBase (a game prefab representing the unlockable item). Ensure the referenced prefab is available/loaded at runtime before using it in UI code. -
public TransportType m_Type
Enum value indicating the transport category/type (for example bus, tram, train, etc.). Used to group or filter transport items in the UI. -
public string m_Icon
String identifier for the icon used to represent this transport item in the UI (sprite name, atlas key, or resource path depending on how the UI system resolves icons).
Properties
- (none)
This class exposes only public fields; there are no properties defined.
Constructors
public UITransportItem()
Default parameterless constructor (compiler-provided). Fields are initialized to their default values (null for m_Unlockable, default enum value for m_Type, null for m_Icon).
Methods
- (none)
This type contains no methods; it is a simple data holder.
Usage Example
// create a transport UI item and populate its fields
var item = new UITransportItem
{
m_Unlockable = myPrefabBaseReference, // assign a loaded PrefabBase
m_Type = TransportType.Bus,
m_Icon = "icon_bus" // icon key used by the UI
};
// use 'item' to populate a UI list or pass to a UI panel renderer
Notes: - The [Serializable] attribute allows Unity/game serialization and inspector use when this type is embedded in serializable containers. - When modding, ensure the PrefabBase you assign is loaded (or resolved) before you attempt to display or interact with it to avoid null references.