Skip to content

Game.Prefabs.NetSubSectionInfo

Assembly: Assembly-CSharp
Namespace: Game.Prefabs

Type: class

Base: System.Object

Summary:
Serializable data container used by net (road/rail/track) prefabs to describe a subsection of a net section. A NetSubSectionInfo groups a reference to a NetSectionPrefab (the subsection prefab) together with rules that specify which net pieces must be present, which pieces any one of must be present, and which pieces must be absent for this subsection to be considered valid. This data is typically serialized with prefab definitions and consumed by the net prefab loading/validation logic.


Fields

  • public NetSectionPrefab m_Section
    Reference to the subsection prefab (the actual section prefab that represents this sub-part of the full net section). This defines the visual/functional subsection that can be spawned when the subsection's requirements are met.

  • public NetPieceRequirements[] m_RequireAll
    An array of NetPieceRequirements that all must be satisfied for this subsection to be valid. All listed requirements must match/hold true at the location where the subsection is considered.

  • public NetPieceRequirements[] m_RequireAny
    An array of NetPieceRequirements where at least one requirement must be satisfied for this subsection to be valid. Use this to express alternative acceptable pieces or conditions.

  • public NetPieceRequirements[] m_RequireNone
    An array of NetPieceRequirements that must not be present. If any of these requirements match, the subsection is considered invalid for placement.

Properties

This type does not declare any public properties.

Constructors

  • public NetSubSectionInfo()
    Default parameterless constructor. Instances are typically created when deserializing prefab asset data; you can also construct one in code and populate fields before assigning it to a prefab structure.

Methods

This type does not declare any methods.

Usage Example

// Example: create and populate a subsection info in code.
// NetSectionPrefab and NetPieceRequirements are other prefab/data types defined elsewhere in the game's codebase.

var subSectionInfo = new NetSubSectionInfo();
subSectionInfo.m_Section = myNetSectionPrefab;

// require that both pieces A and B are present
subSectionInfo.m_RequireAll = new[]
{
    new NetPieceRequirements { /* populate requirement for piece A */ },
    new NetPieceRequirements { /* populate requirement for piece B */ }
};

// require that at least one of C or D is present
subSectionInfo.m_RequireAny = new[]
{
    new NetPieceRequirements { /* requirement for piece C */ },
    new NetPieceRequirements { /* requirement for piece D */ }
};

// require that piece E must NOT be present
subSectionInfo.m_RequireNone = new[]
{
    new NetPieceRequirements { /* requirement for piece E */ }
};

// Then assign subSectionInfo to the appropriate section/prefab data structure
// e.g. mySectionPrefab.m_SubSections = new[] { subSectionInfo };

{{ Notes for modders: When authoring NetSubSectionInfo instances in asset files or code, ensure that referenced NetSectionPrefab assets are valid and that NetPieceRequirements values correctly reference piece identifiers or conditions used by the net placement/validation code. Null or empty requirement arrays typically mean "no constraint" for that category. }}