Game.InfoviewNetGeometryData
Assembly: Assembly-CSharp (game code; the exact assembly may vary)
Namespace: Game.Prefabs
Type: struct
Base: Unity.Entities.IComponentData, Unity.Entities.IQueryTypeParameter
Summary:
InfoviewNetGeometryData is a small ECS component used to tag entities with a NetType value. It's a value-type component (struct) intended to be used in Unity's DOTS/ECS systems to identify the network/road geometry type associated with an entity (for example road, highway, rail, etc.). Because it implements IQueryTypeParameter, it can be used directly in queries/ForEach patterns to filter or read data. The actual NetType enum is defined elsewhere in the game's codebase and represents the different network types used by the game's net system.
Fields
public NetType m_Type
Holds the network type for this entity. As a public enum field it is read/writable. When default-constructed (struct default), this will have the enum's default value (typically the zero/first enum member). This field is the only stored state in the component and is used by systems that inspect or drive behaviour based on the kind of network geometry an entity represents.
Properties
- None
Constructors
public InfoviewNetGeometryData()
Structs have an implicit parameterless constructor that initializes m_Type to the enum's default value. You can also create instances with an object initializer, e.g.new InfoviewNetGeometryData { m_Type = NetType.Road }
.
Methods
- None (this is a plain data container component)
Usage Example
// Adding the component to an Entity (EntityManager)
var data = new InfoviewNetGeometryData { m_Type = NetType.Road };
entityManager.AddComponentData(entity, data);
// Using in a SystemBase query (read-only)
Entities
.WithName("ProcessInfoviewNetGeometry")
.ForEach((in InfoviewNetGeometryData geom) =>
{
// Inspect geom.m_Type and act accordingly
// e.g. if (geom.m_Type == NetType.Highway) { ... }
}).Run();
// Using with an EntityCommandBuffer (authoring/creation time)
var ecb = new EntityCommandBuffer(Allocator.Temp);
ecb.AddComponent(entity, new InfoviewNetGeometryData { m_Type = NetType.Train });
// later playback ecb.Playback(entityManager);
{{ Notes - The NetType enum is defined elsewhere in the game's code; look up its definition to see the available values and semantics. - Because this component is an IComponentData struct, prefer using EntityCommandBuffer when creating/modifying entities from background jobs or structural changes inside jobs. - IQueryTypeParameter makes this component usable directly in queries for filtering or reading; there are no methods or logic inside the component itself — behavior is implemented in systems that read this field. }}