Skip to content

Game.Prefabs.NetSubSection

Assembly: Assembly-CSharp
Namespace: Game.Prefabs

Type: struct

Base: Unity.Entities.IBufferElementData

Summary:
NetSubSection is an ECS buffer element used to reference and qualify a subsection entity of a network prefab. It stores the referenced subsection Entity together with bitflag fields (CompositionFlags and NetSectionFlags) that describe composition and section inclusion/exclusion criteria for that subsection. This struct is intended for use with DynamicBuffer on a parent entity that aggregates multiple subsections.


Fields

  • public Entity m_SubSection
    Reference to the subsection Entity (an ECS entity representing a network subsection/prefab segment). This is the primary link to the actual subsection content.

  • public CompositionFlags m_CompositionAll
    Bitflags that must all be present in the subsection's composition for this entry to apply. Treated as an "all required" mask.

  • public CompositionFlags m_CompositionAny
    Bitflags where at least one must be present in the subsection's composition for this entry to apply. Treated as an "any of" mask.

  • public CompositionFlags m_CompositionNone
    Bitflags that must NOT be present in the subsection's composition for this entry to apply. Treated as an exclusion mask.

  • public NetSectionFlags m_SectionAll
    Bitflags that must all be present in the subsection's net section flags for this entry to apply. Acts as an "all required" mask for section flags.

  • public NetSectionFlags m_SectionAny
    Bitflags where at least one must be present in the subsection's net section flags for this entry to apply. Acts as an "any of" mask for section flags.

  • public NetSectionFlags m_SectionNone
    Bitflags that must NOT be present in the subsection's net section flags for this entry to apply. Acts as an exclusion mask for section flags.

Properties

  • (none)
    This struct exposes only public fields and implements IBufferElementData; it has no properties.

Constructors

  • (implicit default)
    The struct uses the implicit default constructor (value-type default). Initialize fields manually when adding to a DynamicBuffer or create your own helper factory method if convenient.

Methods

  • (none)
    No instance methods are declared; this is a plain data-only buffer element.

Usage Example

// Example: adding subsections to an entity's buffer in a System/Component setup

// Assume `entityManager` is available and `parentEntity` is the entity holding subsections.
// Also assume `subSectionEntity` is a previously created subsection entity.

var buffer = entityManager.AddBuffer<Game.Prefabs.NetSubSection>(parentEntity);

buffer.Add(new Game.Prefabs.NetSubSection {
    m_SubSection = subSectionEntity,
    m_CompositionAll = CompositionFlags.None,
    m_CompositionAny = CompositionFlags.SomeFlag,   // example flag
    m_CompositionNone = CompositionFlags.OtherFlag,
    m_SectionAll = NetSectionFlags.SectionA,
    m_SectionAny = NetSectionFlags.SectionB,
    m_SectionNone = NetSectionFlags.None
});

Notes: - CompositionFlags and NetSectionFlags are expected to be enum bitflags used by the game's prefab selection logic. Check their definitions to know which bits correspond to which composition/section semantics. - Because NetSubSection implements IBufferElementData, it should be used with DynamicBuffer (EntityManager.AddBuffer / GetBuffer) in Unity's ECS.