Update EcsDebug.cs

This commit is contained in:
Mikhail 2024-02-14 02:39:42 +08:00
parent 94a99e3121
commit d636d94549

View File

@ -98,7 +98,7 @@ namespace DCFApixels.DragonECS
public static Action<DebugService> OnServiceChanged = delegate { }; public static Action<DebugService> OnServiceChanged = delegate { };
private IntDispenser _idDispenser = new IntDispenser(-1); private IdDispenser _idDispenser = new IdDispenser(4, -1);
private Dictionary<string, int> _nameIdTable = new Dictionary<string, int>(); private Dictionary<string, int> _nameIdTable = new Dictionary<string, int>();
[MethodImpl(MethodImplOptions.AggressiveInlining)] [MethodImpl(MethodImplOptions.AggressiveInlining)]
@ -110,7 +110,7 @@ namespace DCFApixels.DragonECS
int id; int id;
if (!_nameIdTable.TryGetValue(name, out id)) if (!_nameIdTable.TryGetValue(name, out id))
{ {
id = _idDispenser.GetFree(); id = _idDispenser.UseFree();
_nameIdTable.Add(name, id); _nameIdTable.Add(name, id);
} }
OnNewProfilerMark(id, name); OnNewProfilerMark(id, name);