Game.Prefabs.TrafficConfigurationData
Assembly: Assembly-CSharp (game code / modding assembly)
Namespace: Game.Prefabs
Type: struct
Base: System.ValueType
Implements: Unity.Entities.IComponentData, Unity.Entities.IQueryTypeParameter
Summary:
TrafficConfigurationData is a plain ECS component that stores Entity references to notification prefab entities used by the traffic system for different connection types and traffic events (bottlenecks, dead ends, and various connection notifications). It is intended to be attached to a configuration or prefab entity so systems can spawn or reference the correct notification prefabs when needed.
Fields
-
public Entity m_BottleneckNotification
Holds an Entity reference (usually a prefab) used to show or spawn a notification when a traffic bottleneck is detected. -
public Entity m_DeadEndNotification
Entity reference for the dead-end notification prefab used by the traffic system. -
public Entity m_RoadConnectionNotification
Entity reference for a road-connection-related notification prefab. -
public Entity m_TrackConnectionNotification
Entity reference for a track-connection (rail) notification prefab. -
public Entity m_CarConnectionNotification
Entity reference for a car-connection notification prefab. -
public Entity m_ShipConnectionNotification
Entity reference for a ship-connection notification prefab. -
public Entity m_TrainConnectionNotification
Entity reference for a train-connection notification prefab. -
public Entity m_PedestrianConnectionNotification
Entity reference for a pedestrian-connection notification prefab.
(Each field is an Entity handle; when not assigned they will be Entity.Null. These are intended to point to pre-converted prefab entities or other entity assets used for in-game notifications.)
Properties
- This type does not expose any properties. It only contains the public Entity fields listed above.
Constructors
public TrafficConfigurationData()
Default value-type constructor. All Entity fields default to Entity.Null. Create an instance explicitly and set fields before assigning as component data.
Methods
- This struct declares no methods. It is a plain data container implementing IComponentData and IQueryTypeParameter to be used in ECS queries and systems.
Usage Example
using Unity.Entities;
// Example: create a configuration entity and set notification prefab references
public void CreateTrafficConfig(EntityManager entityManager, Entity bottleneckPrefab, Entity deadEndPrefab)
{
// Create an entity that will carry the traffic configuration component
var configEntity = entityManager.CreateEntity(typeof(Game.Prefabs.TrafficConfigurationData));
var config = new Game.Prefabs.TrafficConfigurationData
{
m_BottleneckNotification = bottleneckPrefab,
m_DeadEndNotification = deadEndPrefab,
// set other notification fields as needed...
m_RoadConnectionNotification = Entity.Null,
m_TrackConnectionNotification = Entity.Null,
m_CarConnectionNotification = Entity.Null,
m_ShipConnectionNotification = Entity.Null,
m_TrainConnectionNotification = Entity.Null,
m_PedestrianConnectionNotification = Entity.Null
};
entityManager.SetComponentData(configEntity, config);
}
Notes:
- The referenced Entities are typically pre-converted notification prefabs or template entities prepared by a conversion system (e.g., from GameObject to Entity during conversion).
- Because this implements IQueryTypeParameter, the struct can be used as a query parameter type in systems that support that pattern to fetch configuration data.