Game.Prefabs.NetLaneMeshInfo
Assembly: Assembly-CSharp.dll
Namespace: Game.Prefabs
Type: class
Base: System.Object
Summary:
Holds a reference to a render prefab (mesh/material information) and a set of boolean flags that control when this mesh variant should be used for a road/rail lane. This class is serialized with the asset (marked [Serializable]) and is used by net prefabs to provide alternate lane visuals depending on lane properties (editor mode, traffic side, crossings, safety, etc.).
Fields
-
public RenderPrefab m_Mesh
Reference to the RenderPrefab that contains the mesh, materials and rendering settings for this lane variant. This is the visual asset that will be applied when the other requirements are satisfied. -
public bool m_RequireSafe
If true, this mesh is intended for lanes that are marked as "safe" (i.e., lanes with safety-related flags). When set, the mesh will only be selected for lanes that expose the corresponding safe flag. -
public bool m_RequireLevelCrossing
If true, this mesh is used only when the lane features a level crossing (e.g., where a road crosses rails at-grade). Use to provide a specialized mesh for level-crossing sections. -
public bool m_RequireEditor
If true, this mesh is intended for use in editor mode only (for example, a visual aid shown only while editing the net). It will typically not be used for in-game runtime rendering. -
public bool m_RequireTrackCrossing
If true, this mesh is used when the lane includes a track crossing (where tracks cross the lane or are physically interacting with it). Useful for tram/rail integrations. -
public bool m_RequireClear
If true, this mesh variant is intended for "clear" lanes (e.g., lanes without decorations, objects, or overlays). Use to select a simplified mesh when the lane state is clear. -
public bool m_RequireLeftHandTraffic
If true, this mesh is intended for left-hand traffic configurations. When set, the mesh will be chosen only if the city/locale is using left-hand driving. -
public bool m_RequireRightHandTraffic
If true, this mesh is intended for right-hand traffic configurations. When set, the mesh will be chosen only if the city/locale is using right-hand driving.
Notes: - Multiple requirement flags may be combined to create a mesh variant that only applies when all specified conditions are met. - If no requirement flags are set, the mesh is treated as a default variant and can be used regardless of those specific lane properties.
Properties
- None (all data is exposed via public fields).
Constructors
public NetLaneMeshInfo()
Default constructor generated by the runtime. Initializes fields to their default values (m_Mesh = null, all booleans = false). Instances are typically created by the asset serializer when loading net prefab data or constructed by tooling when authoring custom net assets.
Methods
- None (this class is a plain data container; selection logic is performed by the surrounding net/renderer code that reads these fields).
Usage Example
// Example usage when constructing or modifying a net prefab in code.
// Assume 'someRenderPrefab' is a valid RenderPrefab reference obtained elsewhere.
var laneMeshInfo = new Game.Prefabs.NetLaneMeshInfo();
laneMeshInfo.m_Mesh = someRenderPrefab;
laneMeshInfo.m_RequireLevelCrossing = true;
laneMeshInfo.m_RequireRightHandTraffic = true;
// Add laneMeshInfo to the net prefab's lane mesh list so the renderer can pick it
// when the lane has a level crossing and the city uses right-hand traffic.
someNetPrefab.laneMeshInfos.Add(laneMeshInfo);
Additional tips: - When authoring custom net assets, create multiple NetLaneMeshInfo entries to cover different combinations (editor vs runtime, left/right traffic, crossings). - Keep meshes minimal for special cases and use fallback/default entries (no requirements) to avoid missing visuals at runtime.