mirror of
https://github.com/DCFApixels/DragonECS.git
synced 2025-09-18 09:54:35 +08:00
rename ProfilerMarker to EcsProfilerMarker
This commit is contained in:
parent
67a57621d5
commit
a7afdfdde3
@ -1,6 +1,4 @@
|
||||
using DCFApixels.DragonECS.Profile;
|
||||
|
||||
namespace DCFApixels.DragonECS
|
||||
namespace DCFApixels.DragonECS
|
||||
{
|
||||
|
||||
public interface IEcsPreInitSystem : IEcsSystem
|
||||
@ -25,7 +23,7 @@ namespace DCFApixels.DragonECS
|
||||
public sealed class EcsPreInitRunner : EcsRunner<IEcsPreInitSystem>, IEcsPreInitSystem
|
||||
{
|
||||
#if DEBUG
|
||||
private ProfilerMarker[] _markers;
|
||||
private EcsProfilerMarker[] _markers;
|
||||
#endif
|
||||
public void PreInit(EcsPipeline pipeline)
|
||||
{
|
||||
@ -43,10 +41,10 @@ namespace DCFApixels.DragonECS
|
||||
#if DEBUG
|
||||
protected override void OnSetup()
|
||||
{
|
||||
_markers = new ProfilerMarker[targets.Length];
|
||||
_markers = new EcsProfilerMarker[targets.Length];
|
||||
for (int i = 0; i < targets.Length; i++)
|
||||
{
|
||||
_markers[i] = new ProfilerMarker(EcsDebug.RegisterMark($"EcsRunner.{targets[i].GetType().Name}.{nameof(PreInit)}"));
|
||||
_markers[i] = new EcsProfilerMarker(EcsDebug.RegisterMark($"EcsRunner.{targets[i].GetType().Name}.{nameof(PreInit)}"));
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@ -54,7 +52,7 @@ namespace DCFApixels.DragonECS
|
||||
public sealed class EcsInitRunner : EcsRunner<IEcsInitSystem>, IEcsInitSystem
|
||||
{
|
||||
#if DEBUG
|
||||
private ProfilerMarker[] _markers;
|
||||
private EcsProfilerMarker[] _markers;
|
||||
#endif
|
||||
public void Init(EcsPipeline pipeline)
|
||||
{
|
||||
@ -72,10 +70,10 @@ namespace DCFApixels.DragonECS
|
||||
#if DEBUG
|
||||
protected override void OnSetup()
|
||||
{
|
||||
_markers = new ProfilerMarker[targets.Length];
|
||||
_markers = new EcsProfilerMarker[targets.Length];
|
||||
for (int i = 0; i < targets.Length; i++)
|
||||
{
|
||||
_markers[i] = new ProfilerMarker(EcsDebug.RegisterMark($"EcsRunner.{targets[i].GetType().Name}.{nameof(Init)}"));
|
||||
_markers[i] = new EcsProfilerMarker(EcsDebug.RegisterMark($"EcsRunner.{targets[i].GetType().Name}.{nameof(Init)}"));
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@ -83,7 +81,7 @@ namespace DCFApixels.DragonECS
|
||||
public sealed class EcsRunRunner : EcsRunner<IEcsRunSystem>, IEcsRunSystem
|
||||
{
|
||||
#if DEBUG
|
||||
private ProfilerMarker[] _markers;
|
||||
private EcsProfilerMarker[] _markers;
|
||||
#endif
|
||||
public void Run(EcsPipeline pipeline)
|
||||
{
|
||||
@ -102,10 +100,10 @@ namespace DCFApixels.DragonECS
|
||||
#if DEBUG
|
||||
protected override void OnSetup()
|
||||
{
|
||||
_markers = new ProfilerMarker[targets.Length];
|
||||
_markers = new EcsProfilerMarker[targets.Length];
|
||||
for (int i = 0; i < targets.Length; i++)
|
||||
{
|
||||
_markers[i] = new ProfilerMarker(EcsDebug.RegisterMark($"EcsRunner.{targets[i].GetType().Name}.{nameof(Run)}"));
|
||||
_markers[i] = new EcsProfilerMarker(EcsDebug.RegisterMark($"EcsRunner.{targets[i].GetType().Name}.{nameof(Run)}"));
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@ -113,7 +111,7 @@ namespace DCFApixels.DragonECS
|
||||
public sealed class EcsDestroyRunner : EcsRunner<IEcsDestroySystem>, IEcsDestroySystem
|
||||
{
|
||||
#if DEBUG
|
||||
private ProfilerMarker[] _markers;
|
||||
private EcsProfilerMarker[] _markers;
|
||||
#endif
|
||||
public void Destroy(EcsPipeline pipeline)
|
||||
{
|
||||
@ -131,10 +129,10 @@ namespace DCFApixels.DragonECS
|
||||
#if DEBUG
|
||||
protected override void OnSetup()
|
||||
{
|
||||
_markers = new ProfilerMarker[targets.Length];
|
||||
_markers = new EcsProfilerMarker[targets.Length];
|
||||
for (int i = 0; i < targets.Length; i++)
|
||||
{
|
||||
_markers[i] = new ProfilerMarker(EcsDebug.RegisterMark($"EcsRunner.{targets[i].GetType().Name}.{nameof(Destroy)}"));
|
||||
_markers[i] = new EcsProfilerMarker(EcsDebug.RegisterMark($"EcsRunner.{targets[i].GetType().Name}.{nameof(Destroy)}"));
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
@ -5,31 +5,29 @@ using System.Runtime.CompilerServices;
|
||||
|
||||
namespace DCFApixels.DragonECS
|
||||
{
|
||||
namespace Profile
|
||||
public readonly struct EcsProfilerMarker
|
||||
{
|
||||
public readonly struct ProfilerMarker
|
||||
{
|
||||
public readonly int id;
|
||||
public ProfilerMarker(int id) => this.id = id;
|
||||
public void Begin() => EcsDebug.ProfileMarkBegin(id);
|
||||
public void End() => EcsDebug.ProfileMarkEnd(id);
|
||||
public AutoScope Auto() => new AutoScope(id);
|
||||
public readonly int id;
|
||||
public EcsProfilerMarker(int id) => this.id = id;
|
||||
public void Begin() => EcsDebug.ProfileMarkBegin(id);
|
||||
public void End() => EcsDebug.ProfileMarkEnd(id);
|
||||
public AutoScope Auto() => new AutoScope(id);
|
||||
|
||||
public readonly struct AutoScope : IDisposable
|
||||
public readonly struct AutoScope : IDisposable
|
||||
{
|
||||
private readonly int id;
|
||||
public AutoScope(int id)
|
||||
{
|
||||
private readonly int id;
|
||||
public AutoScope(int id)
|
||||
{
|
||||
this.id = id;
|
||||
EcsDebug.ProfileMarkBegin(id);
|
||||
}
|
||||
public void Dispose()
|
||||
{
|
||||
EcsDebug.ProfileMarkEnd(id);
|
||||
}
|
||||
this.id = id;
|
||||
EcsDebug.ProfileMarkBegin(id);
|
||||
}
|
||||
public void Dispose()
|
||||
{
|
||||
EcsDebug.ProfileMarkEnd(id);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static class EcsDebug
|
||||
{
|
||||
public static void Set<T>() where T : DebugService, new() => DebugService.Set<T>();
|
||||
|
Loading…
Reference in New Issue
Block a user