2023-04-24 16:48:26 +08:00
|
|
|
|
using DCFApixels.DragonECS.RunnersCore;
|
|
|
|
|
|
|
|
|
|
|
|
namespace DCFApixels.DragonECS
|
2023-03-31 14:58:50 +08:00
|
|
|
|
{
|
2023-05-30 18:31:03 +08:00
|
|
|
|
public interface IEcsLateRunProcess : IEcsProcess
|
2023-03-31 14:58:50 +08:00
|
|
|
|
{
|
|
|
|
|
|
public void LateRun(EcsPipeline pipeline);
|
|
|
|
|
|
}
|
|
|
|
|
|
public static class IEcsLateRunSystemExtensions
|
|
|
|
|
|
{
|
|
|
|
|
|
public static void LateRun(this EcsPipeline systems)
|
|
|
|
|
|
{
|
2023-05-07 00:50:44 +08:00
|
|
|
|
systems.GetRunner<IEcsLateRunProcess>().LateRun(systems);
|
2023-03-31 14:58:50 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|
2023-05-30 18:31:03 +08:00
|
|
|
|
public interface IEcsFixedRunProcess : IEcsProcess
|
2023-03-31 14:58:50 +08:00
|
|
|
|
{
|
|
|
|
|
|
public void FixedRun(EcsPipeline pipeline);
|
|
|
|
|
|
}
|
2023-04-24 16:48:26 +08:00
|
|
|
|
public static class IEcsFixedRunSystemExtensions
|
|
|
|
|
|
{
|
|
|
|
|
|
public static void FixedRun(this EcsPipeline pipeline)
|
|
|
|
|
|
{
|
2023-05-07 00:50:44 +08:00
|
|
|
|
pipeline.GetRunner<IEcsFixedRunProcess>().FixedRun(pipeline);
|
2023-04-24 16:48:26 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
namespace Internal
|
2023-03-31 14:58:50 +08:00
|
|
|
|
{
|
2023-04-24 16:48:26 +08:00
|
|
|
|
[DebugColor(DebugColor.Orange)]
|
2023-05-07 00:50:44 +08:00
|
|
|
|
public class EcsLateRunSystemRunner : EcsRunner<IEcsLateRunProcess>, IEcsLateRunProcess
|
2023-04-24 16:48:26 +08:00
|
|
|
|
{
|
2023-04-07 05:09:20 +08:00
|
|
|
|
#if DEBUG && !DISABLE_DEBUG
|
2023-04-24 16:48:26 +08:00
|
|
|
|
private EcsProfilerMarker[] _markers;
|
2023-03-31 14:58:50 +08:00
|
|
|
|
#endif
|
2023-04-24 16:48:26 +08:00
|
|
|
|
public void LateRun(EcsPipeline pipeline)
|
|
|
|
|
|
{
|
2023-04-07 05:09:20 +08:00
|
|
|
|
#if DEBUG && !DISABLE_DEBUG
|
2023-04-24 16:48:26 +08:00
|
|
|
|
for (int i = 0; i < targets.Length; i++)
|
|
|
|
|
|
{
|
|
|
|
|
|
using (_markers[i].Auto())
|
|
|
|
|
|
targets[i].LateRun(pipeline);
|
|
|
|
|
|
}
|
|
|
|
|
|
#else
|
|
|
|
|
|
foreach (var item in targets) item.LateRun(pipeline);
|
|
|
|
|
|
#endif
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
#if DEBUG && !DISABLE_DEBUG
|
|
|
|
|
|
protected override void OnSetup()
|
2023-03-31 14:58:50 +08:00
|
|
|
|
{
|
2023-04-24 16:48:26 +08:00
|
|
|
|
_markers = new EcsProfilerMarker[targets.Length];
|
|
|
|
|
|
for (int i = 0; i < targets.Length; i++)
|
|
|
|
|
|
{
|
|
|
|
|
|
_markers[i] = new EcsProfilerMarker(EcsDebug.RegisterMark($"EcsRunner.{targets[i].GetType().Name}.{nameof(LateRun)}"));
|
|
|
|
|
|
}
|
2023-03-31 14:58:50 +08:00
|
|
|
|
}
|
2023-04-24 16:48:26 +08:00
|
|
|
|
#endif
|
|
|
|
|
|
}
|
|
|
|
|
|
[DebugColor(DebugColor.Orange)]
|
2023-05-07 00:50:44 +08:00
|
|
|
|
public class EcsFixedRunSystemRunner : EcsRunner<IEcsFixedRunProcess>, IEcsFixedRunProcess
|
2023-04-24 16:48:26 +08:00
|
|
|
|
{
|
|
|
|
|
|
#if DEBUG && !DISABLE_DEBUG
|
|
|
|
|
|
private EcsProfilerMarker[] _markers;
|
|
|
|
|
|
#endif
|
|
|
|
|
|
public void FixedRun(EcsPipeline pipeline)
|
|
|
|
|
|
{
|
|
|
|
|
|
#if DEBUG && !DISABLE_DEBUG
|
|
|
|
|
|
for (int i = 0; i < targets.Length; i++)
|
|
|
|
|
|
{
|
|
|
|
|
|
using (_markers[i].Auto())
|
|
|
|
|
|
targets[i].FixedRun(pipeline);
|
|
|
|
|
|
}
|
2023-03-31 14:58:50 +08:00
|
|
|
|
#else
|
|
|
|
|
|
foreach (var item in targets) item.FixedRun(pipeline);
|
|
|
|
|
|
#endif
|
2023-04-24 16:48:26 +08:00
|
|
|
|
}
|
2023-03-31 14:58:50 +08:00
|
|
|
|
|
2023-04-07 05:09:20 +08:00
|
|
|
|
#if DEBUG && !DISABLE_DEBUG
|
2023-04-24 16:48:26 +08:00
|
|
|
|
protected override void OnSetup()
|
2023-03-31 14:58:50 +08:00
|
|
|
|
{
|
2023-04-24 16:48:26 +08:00
|
|
|
|
_markers = new EcsProfilerMarker[targets.Length];
|
|
|
|
|
|
for (int i = 0; i < targets.Length; i++)
|
|
|
|
|
|
{
|
|
|
|
|
|
_markers[i] = new EcsProfilerMarker(EcsDebug.RegisterMark($"EcsRunner.{targets[i].GetType().Name}.{nameof(FixedRun)}"));
|
|
|
|
|
|
}
|
2023-03-31 14:58:50 +08:00
|
|
|
|
}
|
|
|
|
|
|
#endif
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|