using HighwayRacers; using System; using System.Collections; using System.Collections.Generic; using Unity.Collections; using Unity.Entities; using Unity.Mathematics; using UnityEngine; [UpdateAfter(typeof(TrackOccupancySystem))] public class StreetDefinitionSystem : SystemBase { protected override void OnCreate() { UnityEngine.Debug.Log(">> TrackDefinitionSystem Created."); } protected override void OnUpdate() { } public DynamicBuffer GetBuffer(int StreetIndex) { var streetEntities = GetEntityQuery(typeof(StreetDataElement)).ToEntityArray(Allocator.Temp); return EntityManager.GetBuffer(streetEntities[StreetIndex]); } public StreetTraffic GetTraffic(int StreetIndex) { var streetEntities = GetEntityQuery(typeof(StreetDataElement)).ToEntityArray(Allocator.Temp); return EntityManager.GetComponentData(streetEntities[StreetIndex]); } }