Skip to content

Game.Prefabs.NetLaneInfo

Assembly: Assembly-CSharp
Namespace: Game.Prefabs

Type: class

Base: System.Object

Summary:
A small serializable data container used by net prefabs to describe a single lane. It holds a reference to the lane prefab, a 3D position (float3) and a boolean hint for anchor-finding logic. This struct-like class is commonly serialized into net/prefab data so the game or mod code can read/write lane placement information for roads, tracks and other net objects.


Fields

  • public NetLanePrefab m_Lane
    Reference to the lane prefab asset that defines the lane's visual/functional behavior. Can be null if no specific lane prefab is assigned.

  • public Unity.Mathematics.float3 m_Position
    Position of the lane. Typically used as local coordinates relative to the parent net segment/prefab pivot (x, y, z). Uses Unity.Mathematics.float3 for compact numeric storage.

  • public bool m_FindAnchor
    Flag indicating whether placement logic should attempt to locate an anchor point when positioning this lane. Acts as a hint to the engine/mod code that the lane should try to snap to a nearby anchor (vertex/attachment point) rather than using the raw position alone.

Properties

  • None. This class exposes plain public fields and does not define properties.

Constructors

  • public NetLaneInfo()
    Default constructor generated by the compiler. Initializes reference fields to null, m_Position to float3(0,0,0) and m_FindAnchor to false unless changed after construction.

Methods

  • None. This class contains only data fields and no behavior (methods).

Usage Example

using Unity.Mathematics;
using Game.Prefabs;

// Create and populate a lane info instance
NetLaneInfo laneInfo = new NetLaneInfo();
laneInfo.m_Lane = myNetLanePrefab;          // assign a NetLanePrefab reference obtained from assets
laneInfo.m_Position = new float3(1.0f, 0f, 0.5f); // local position relative to the parent net
laneInfo.m_FindAnchor = true;               // request anchor snapping when placing the lane

// Or using object initializer
var laneInfo2 = new NetLaneInfo {
    m_Lane = anotherLanePrefab,
    m_Position = new float3(0f, 0f, 0f),
    m_FindAnchor = false
};

// Because the class is marked [Serializable], instances are suitable for Unity/engine serialization
// and can be stored in prefab data or custom save structures used by mods.