#if UNITY_EDITOR using Unity.Burst; using Unity.Entities; namespace GarmentButton.PathFinding { public partial struct DebugPathCalculationSystem : ISystem { [BurstCompile] public void OnCreate(ref SystemState state) { var query = SystemAPI.QueryBuilder().WithAll().Build(); state.RequireForUpdate(); state.RequireForUpdate(); state.RequireForUpdate(query); } public void OnUpdate(ref SystemState state) { var grid = SystemAPI.GetSingleton().Value; var pointData = SystemAPI.GetSingletonBuffer(); var entityPathFinder = SystemAPI.GetSingletonEntity(); var entity = SystemAPI.GetSingletonEntity(); var texts = state.EntityManager.GetComponentData(entity); state.Dependency.Complete(); for (int i = 0; i < grid.Value.Array.Length; i++) { var text = texts.Text[i]; text.text = $"{pointData[i].Cost}"; } state.EntityManager.RemoveComponent(entityPathFinder); } } } #endif