mirror of
https://github.com/DCFApixels/DragonECS.git
synced 2026-04-22 01:45:55 +08:00
Add flag to disable markers in runners
This commit is contained in:
parent
4512245e57
commit
3a29f99e52
@ -142,7 +142,9 @@ namespace DCFApixels.DragonECS.Core.Internal
|
||||
for (int i = 0, n = _pairs.Length < _markers.Length ? _pairs.Length : _markers.Length; i < n; i++)
|
||||
{
|
||||
var pair = _pairs[i];
|
||||
#if !DRAGONECS_DISABLE_PROFILER_MARKERS
|
||||
_markers[i].Begin();
|
||||
#endif
|
||||
try
|
||||
{
|
||||
pair.run.Run();
|
||||
@ -159,7 +161,9 @@ namespace DCFApixels.DragonECS.Core.Internal
|
||||
{
|
||||
pair.cleanup?.RunFinally();
|
||||
}
|
||||
#if !DRAGONECS_DISABLE_PROFILER_MARKERS
|
||||
_markers[i].End();
|
||||
#endif
|
||||
}
|
||||
#else
|
||||
foreach (var item in Process)
|
||||
|
||||
@ -307,7 +307,7 @@ namespace DCFApixels.DragonECS
|
||||
#endif
|
||||
public EcsPipeline Build()
|
||||
{
|
||||
#if DEBUG
|
||||
#if DEBUG && !DRAGONECS_DISABLE_PROFILER_MARKERS
|
||||
_buildMarker.Begin();
|
||||
#endif
|
||||
var it = new LinkedListCountIterator<SystemNode>(_systemNodes, _systemNodesCount, _startIndex);
|
||||
@ -373,7 +373,7 @@ namespace DCFApixels.DragonECS
|
||||
{
|
||||
item.Declare(pipeline);
|
||||
}
|
||||
#if DEBUG
|
||||
#if DEBUG && !DRAGONECS_DISABLE_PROFILER_MARKERS
|
||||
_buildMarker.End();
|
||||
#endif
|
||||
return pipeline;
|
||||
|
||||
@ -208,7 +208,7 @@ namespace DCFApixels.DragonECS
|
||||
EcsDebug.PrintWarning($"This {nameof(EcsPipeline)} has already been initialized");
|
||||
return;
|
||||
}
|
||||
#if DEBUG
|
||||
#if DEBUG && !DRAGONECS_DISABLE_PROFILER_MARKERS
|
||||
_initMarker.Begin();
|
||||
#endif
|
||||
|
||||
@ -219,7 +219,7 @@ namespace DCFApixels.DragonECS
|
||||
_isInit = true;
|
||||
|
||||
GC.Collect();
|
||||
#if DEBUG
|
||||
#if DEBUG && !DRAGONECS_DISABLE_PROFILER_MARKERS
|
||||
_initMarker.End();
|
||||
#endif
|
||||
}
|
||||
|
||||
@ -201,7 +201,9 @@ namespace DCFApixels.DragonECS
|
||||
CheckCache(translationCallback);
|
||||
for (int i = 0, n = _process.Length < _markers.Length ? _process.Length : _markers.Length; i < n; i++)
|
||||
{
|
||||
#if !DRAGONECS_DISABLE_PROFILER_MARKERS
|
||||
_markers[i].Begin();
|
||||
#endif
|
||||
try
|
||||
{
|
||||
translationCallback(_process[i]);
|
||||
@ -214,7 +216,9 @@ namespace DCFApixels.DragonECS
|
||||
EcsDebug.PrintError(e);
|
||||
#endif
|
||||
}
|
||||
#if !DRAGONECS_DISABLE_PROFILER_MARKERS
|
||||
_markers[i].End();
|
||||
#endif
|
||||
}
|
||||
#else
|
||||
foreach (var item in _process)
|
||||
@ -242,7 +246,9 @@ namespace DCFApixels.DragonECS
|
||||
CheckCache(translationCallback);
|
||||
for (int i = 0, n = _process.Length < _markers.Length ? _process.Length : _markers.Length; i < n; i++)
|
||||
{
|
||||
#if !DRAGONECS_DISABLE_PROFILER_MARKERS
|
||||
_markers[i].Begin();
|
||||
#endif
|
||||
try
|
||||
{
|
||||
translationCallback(_process[i], ref data);
|
||||
@ -255,7 +261,9 @@ namespace DCFApixels.DragonECS
|
||||
EcsDebug.PrintError(e);
|
||||
#endif
|
||||
}
|
||||
#if !DRAGONECS_DISABLE_PROFILER_MARKERS
|
||||
_markers[i].End();
|
||||
#endif
|
||||
}
|
||||
#else
|
||||
foreach (var item in _process)
|
||||
@ -370,7 +378,9 @@ namespace DCFApixels.DragonECS
|
||||
for (int i = 0, n = _pairs.Length < _markers.Length ? _pairs.Length : _markers.Length; i < n; i++)
|
||||
{
|
||||
var pair = _pairs[i];
|
||||
#if !DRAGONECS_DISABLE_PROFILER_MARKERS
|
||||
_markers[i].Begin();
|
||||
#endif
|
||||
try
|
||||
{
|
||||
translationCallback(pair.run);
|
||||
@ -390,7 +400,9 @@ namespace DCFApixels.DragonECS
|
||||
translationFinnalyCallback(pair.runFinally);
|
||||
}
|
||||
}
|
||||
#if !DRAGONECS_DISABLE_PROFILER_MARKERS
|
||||
_markers[i].End();
|
||||
#endif
|
||||
}
|
||||
#else
|
||||
foreach (var item in _pairs)
|
||||
@ -426,7 +438,9 @@ namespace DCFApixels.DragonECS
|
||||
for (int i = 0, n = _pairs.Length < _markers.Length ? _pairs.Length : _markers.Length; i < n; i++)
|
||||
{
|
||||
var pair = _pairs[i];
|
||||
#if !DRAGONECS_DISABLE_PROFILER_MARKERS
|
||||
_markers[i].Begin();
|
||||
#endif
|
||||
try
|
||||
{
|
||||
translationCallback(pair.run, ref data);
|
||||
@ -446,7 +460,9 @@ namespace DCFApixels.DragonECS
|
||||
translationFinnalyCallback(pair.runFinally, ref data);
|
||||
}
|
||||
}
|
||||
#if !DRAGONECS_DISABLE_PROFILER_MARKERS
|
||||
_markers[i].End();
|
||||
#endif
|
||||
}
|
||||
#else
|
||||
foreach (var pair in _pairs)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user