Game.Prefabs.InfoviewRouteData
Assembly:
Assembly-CSharp (common Unity game assembly; inferred)
Namespace:
Game.Prefabs
Type:
struct
Base:
Implements Unity.Entities.IComponentData, Unity.Entities.IQueryTypeParameter
Summary:
InfoviewRouteData is a small ECS component used to tag or store the route type for an entity (for example, an infoview element that should display data for a particular route). The actual route type is defined by Game.Routes.RouteType. The struct is a value-type component meant to be attached to entities in the Unity.Entities (DOTS) world and can be used in queries because it implements IQueryTypeParameter.
Fields
public Game.Routes.RouteType m_Type
Holds the route category/type for the entity (e.g., bus, train, etc.). The RouteType enum is defined in the Game.Routes namespace. Use this field to read or set which route the infoview entry corresponds to.
Properties
This type exposes no properties.
Constructors
- Implicit parameterless constructor (default for C# structs)
Structs in C# receive an implicit parameterless constructor that initializes fields to their default values. You can also use an object initializer to set m_Type when creating an instance.
Methods
This type defines no methods.
Usage Example
using Unity.Entities;
using Game.Prefabs;
using Game.Routes;
// create component data with a specific route type
var routeData = new InfoviewRouteData { m_Type = RouteType.Bus };
// add to an existing entity using an EntityManager
entityManager.AddComponentData(someEntity, routeData);
// or in a system, match entities with this component in a query
Entities
.WithName("ProcessInfoviewRoutes")
.ForEach((Entity entity, ref InfoviewRouteData info) =>
{
// read info.m_Type to determine behavior or display
var type = info.m_Type;
// ... handle route-specific logic
}).Schedule();
Notes: - Because this is a plain struct implementing IComponentData, it is efficient for DOTS workflows and can be used in queries and scheduled jobs. - IQueryTypeParameter indicates it can participate in certain query patterns; consult your DOTS/ECS version docs for advanced query usage.