mirror of
https://github.com/DCFApixels/DragonECS.git
synced 2025-09-18 09:54:35 +08:00
update debug service
This commit is contained in:
parent
de2a0d43ac
commit
708c137c68
@ -143,6 +143,7 @@ namespace DCFApixels.DragonECS
|
|||||||
Name = name;
|
Name = name;
|
||||||
ID = iD;
|
ID = iD;
|
||||||
}
|
}
|
||||||
|
public override string ToString() { return this.AutoToString(); }
|
||||||
}
|
}
|
||||||
public IEnumerable<MarkerInfo> MarkerInfos
|
public IEnumerable<MarkerInfo> MarkerInfos
|
||||||
{
|
{
|
||||||
@ -167,14 +168,15 @@ namespace DCFApixels.DragonECS
|
|||||||
{
|
{
|
||||||
var oldService = _instance;
|
var oldService = _instance;
|
||||||
_instance = service;
|
_instance = service;
|
||||||
|
if(_instance != null)
|
||||||
foreach (var info in oldService.MarkerInfos)
|
{ //TODO Так, всеже треды влияют друг на друга, скоерее всего проблема в использовании _nameIdTable
|
||||||
{
|
foreach (var info in oldService.MarkerInfos)
|
||||||
service._idDispenser.Use(info.ID);
|
{
|
||||||
service._nameIdTable.TryAdd(info.Name, info.ID);
|
service._idDispenser.Use(info.ID);
|
||||||
service.OnNewProfilerMark(info.ID, info.Name);
|
service._nameIdTable.TryAdd(info.Name, info.ID);
|
||||||
|
service.OnNewProfilerMark(info.ID, info.Name);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
service.OnServiceSetup(oldService);
|
service.OnServiceSetup(oldService);
|
||||||
OnServiceChanged(service);
|
OnServiceChanged(service);
|
||||||
}
|
}
|
||||||
@ -263,6 +265,10 @@ namespace DCFApixels.DragonECS
|
|||||||
Name = name;
|
Name = name;
|
||||||
ID = id;
|
ID = id;
|
||||||
}
|
}
|
||||||
|
public override string ToString()
|
||||||
|
{
|
||||||
|
return this.AutoToString();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
private MarkerData[] _stopwatchs;
|
private MarkerData[] _stopwatchs;
|
||||||
[ThreadStatic]
|
[ThreadStatic]
|
||||||
@ -318,10 +324,10 @@ namespace DCFApixels.DragonECS
|
|||||||
|
|
||||||
var color = Console.ForegroundColor;
|
var color = Console.ForegroundColor;
|
||||||
Console.ForegroundColor = ConsoleColor.DarkGray;
|
Console.ForegroundColor = ConsoleColor.DarkGray;
|
||||||
_stopwatchs[id].stopwatch.Start();
|
_stopwatchs[id].Stopwatch.Start();
|
||||||
|
|
||||||
Console.Write(PROFILER_MARKER_CACHE);
|
Console.Write(PROFILER_MARKER_CACHE);
|
||||||
Console.Write(_stopwatchs[id].name);
|
Console.Write(_stopwatchs[id].Name);
|
||||||
Console.WriteLine("> ");
|
Console.WriteLine("> ");
|
||||||
|
|
||||||
Console.ForegroundColor = color;
|
Console.ForegroundColor = color;
|
||||||
@ -332,13 +338,13 @@ namespace DCFApixels.DragonECS
|
|||||||
#if ((DEBUG && !DISABLE_DEBUG) || ENABLE_DRAGONECS_DEBUGGER) && !UNITY_5_3_OR_NEWER
|
#if ((DEBUG && !DISABLE_DEBUG) || ENABLE_DRAGONECS_DEBUGGER) && !UNITY_5_3_OR_NEWER
|
||||||
var color = Console.ForegroundColor;
|
var color = Console.ForegroundColor;
|
||||||
Console.ForegroundColor = ConsoleColor.DarkGray;
|
Console.ForegroundColor = ConsoleColor.DarkGray;
|
||||||
_stopwatchs[id].stopwatch.Stop();
|
_stopwatchs[id].Stopwatch.Stop();
|
||||||
var time = _stopwatchs[id].stopwatch.Elapsed;
|
var time = _stopwatchs[id].Stopwatch.Elapsed;
|
||||||
_stopwatchs[id].stopwatch.Reset();
|
_stopwatchs[id].Stopwatch.Reset();
|
||||||
|
|
||||||
Console.Write(PROFILER_MARKER_CACHE);
|
Console.Write(PROFILER_MARKER_CACHE);
|
||||||
Console.Write("> ");
|
Console.Write("> ");
|
||||||
Console.Write(_stopwatchs[id].name);
|
Console.Write(_stopwatchs[id].Name);
|
||||||
Console.Write(" s:");
|
Console.Write(" s:");
|
||||||
|
|
||||||
int written = 0;
|
int written = 0;
|
||||||
|
Loading…
Reference in New Issue
Block a user