Game.Net.Roundabout
Assembly: Assembly-CSharp (Game)
Namespace: Game.Net
Type: struct
Base: IComponentData, IQueryTypeParameter, IEmptySerializable
Summary: A lightweight ECS component that stores the radius of a roundabout. Intended for use in the game's entity/component systems to tag road-related entities (e.g., nodes or intersections) with a roundabout radius value. Implements the Unity.Entities IComponentData interface so it can be attached to entities, IQueryTypeParameter to be used in entity queries, and Colossal.Serialization.Entities.IEmptySerializable for the game's custom serialization handling.
Fields
public System.Single m_Radius
Stores the roundabout radius as a floating-point value. The value represents distance in the game's world units (typically meters). This is the only data carried by the component.
Properties
- None. This struct exposes no properties — it is a plain data container field-based component.
Constructors
- No explicit constructors.
As a struct, it has the default value-type constructor. Initialize via object-initializer or by assigning the single field, e.g.
new Roundabout { m_Radius = 5f }
.
Methods
- None. There are no methods defined on this struct.
Usage Example
// Example: attaching the Roundabout component to an entity
using Unity.Entities;
using Game.Net;
public void AddRoundaboutToEntity(Entity entity, EntityManager entityManager, float radius)
{
var roundabout = new Roundabout { m_Radius = radius };
entityManager.AddComponentData(entity, roundabout);
}
// Example: reading Roundabout data inside a System
public partial class RoundaboutSystem : SystemBase
{
protected override void OnUpdate()
{
Entities
.ForEach((ref Roundabout r) =>
{
// r.m_Radius contains the roundabout radius
// Perform logic that uses the radius here
})
.ScheduleParallel();
}
}