Skip to content

Game.Rendering.NetSubMesh

Assembly: Assembly-CSharp
Namespace: Game.Rendering

Type: public enum NetSubMesh

Base: System.Enum

Summary:
Enumeration identifying the different sub-mesh roles used by the game's network (road/track) rendering. Values are typically used as sub-mesh indices or to select which mesh piece to draw for a given network segment or node during mesh construction and rendering. Changing the enum values or their ordering can break mappings between code and mesh assets, so treat as a stable contract.


Fields

  • Edge
    Represents the main segment body (the standard edge piece) for a network segment.

  • RotatedEdge
    A rotated variant of the edge mesh. Used when a different orientation or mirrored geometry is required.

  • StartNode
    Mesh piece used for the start node cap of a segment (the node geometry at segment start).

  • EndNode
    Mesh piece used for the end node cap of a segment (the node geometry at segment end).

  • Orphan1
    A standalone/orphan mesh variant. Typically used for isolated or special cases where a segment piece has no connected counterpart.

  • Orphan2
    A second orphan/standalone variant. Provides an alternative geometry for isolated cases.

  • SubStartNode
    A sub-node start mesh used when segments have sub-division or layered node geometry (e.g., sub-segments, overlays).

  • SubEndNode
    A sub-node end mesh used for the corresponding sub-division or layered end geometry.

Properties

  • (none)
    This enum type exposes no properties.

Constructors

  • (implicit)
    Enums have an implicit constructor; no explicit constructors are defined.

Methods

  • (none)
    This enum type defines no methods.

Usage Example

using Game.Rendering;
using UnityEngine;

public class NetRendererExample
{
    public void ApplyMaterialToEdgeSubMesh(Mesh mesh, Material mat)
    {
        // Use the enum value as a sub-mesh index
        int edgeSubMeshIndex = (int)NetSubMesh.Edge;

        // Example: set material to a renderer that uses sub-meshes
        var renderer = /* get renderer */;
        // renderer.materials[edgeSubMeshIndex] = mat; // depends on renderer setup

        // Or use in a switch when constructing geometry
        NetSubMesh piece = NetSubMesh.StartNode;
        switch (piece)
        {
            case NetSubMesh.Edge:
            case NetSubMesh.RotatedEdge:
                // build segment body
                break;
            case NetSubMesh.StartNode:
            case NetSubMesh.EndNode:
                // build node cap
                break;
            case NetSubMesh.Orphan1:
            case NetSubMesh.Orphan2:
                // build standalone piece
                break;
            case NetSubMesh.SubStartNode:
            case NetSubMesh.SubEndNode:
                // build sub-node geometry
                break;
        }
    }
}