mirror of
https://github.com/DCFApixels/DragonECS.git
synced 2025-09-18 18:14:37 +08:00
update debug
This commit is contained in:
parent
0b6c1e8d26
commit
770c8c5522
@ -8,6 +8,7 @@
|
|||||||
public const string DEBUG_PREFIX = "[DEBUG] ";
|
public const string DEBUG_PREFIX = "[DEBUG] ";
|
||||||
public const string DEBUG_WARNING_TAG = "WARNING";
|
public const string DEBUG_WARNING_TAG = "WARNING";
|
||||||
public const string DEBUG_ERROR_TAG = "ERROR";
|
public const string DEBUG_ERROR_TAG = "ERROR";
|
||||||
|
public const string DEBUG_PASS_TAG = "PASS";
|
||||||
|
|
||||||
public const string PRE_BEGIN_LAYER = nameof(PRE_BEGIN_LAYER);
|
public const string PRE_BEGIN_LAYER = nameof(PRE_BEGIN_LAYER);
|
||||||
public const string BEGIN_LAYER = nameof(BEGIN_LAYER);
|
public const string BEGIN_LAYER = nameof(BEGIN_LAYER);
|
||||||
|
@ -33,6 +33,7 @@ namespace DCFApixels.DragonECS
|
|||||||
{
|
{
|
||||||
public const string WARNING_TAG = EcsConsts.DEBUG_WARNING_TAG;
|
public const string WARNING_TAG = EcsConsts.DEBUG_WARNING_TAG;
|
||||||
public const string ERROR_TAG = EcsConsts.DEBUG_ERROR_TAG;
|
public const string ERROR_TAG = EcsConsts.DEBUG_ERROR_TAG;
|
||||||
|
public const string PASS_TAG = EcsConsts.DEBUG_PASS_TAG;
|
||||||
|
|
||||||
public static void Set<T>() where T : DebugService, new() => DebugService.Set<T>();
|
public static void Set<T>() where T : DebugService, new() => DebugService.Set<T>();
|
||||||
public static void Set(DebugService service) => DebugService.Set(service);
|
public static void Set(DebugService service) => DebugService.Set(service);
|
||||||
@ -40,6 +41,7 @@ namespace DCFApixels.DragonECS
|
|||||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||||
public static void PrintWarning(object v) => Print(EcsConsts.DEBUG_WARNING_TAG, v);
|
public static void PrintWarning(object v) => Print(EcsConsts.DEBUG_WARNING_TAG, v);
|
||||||
public static void PrintError(object v) => Print(EcsConsts.DEBUG_ERROR_TAG, v);
|
public static void PrintError(object v) => Print(EcsConsts.DEBUG_ERROR_TAG, v);
|
||||||
|
public static void PrintPass(object v) => Print(EcsConsts.DEBUG_PASS_TAG, v);
|
||||||
public static void Print()
|
public static void Print()
|
||||||
{
|
{
|
||||||
#if !DISABLE_DRAGONECS_DEBUGGER
|
#if !DISABLE_DRAGONECS_DEBUGGER
|
||||||
@ -156,6 +158,9 @@ namespace DCFApixels.DragonECS
|
|||||||
case EcsDebug.WARNING_TAG:
|
case EcsDebug.WARNING_TAG:
|
||||||
Console.ForegroundColor = ConsoleColor.Yellow;
|
Console.ForegroundColor = ConsoleColor.Yellow;
|
||||||
break;
|
break;
|
||||||
|
case EcsDebug.PASS_TAG:
|
||||||
|
Console.ForegroundColor = ConsoleColor.Green;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
Console.WriteLine($"[{tag}] {v}");
|
Console.WriteLine($"[{tag}] {v}");
|
||||||
Console.ForegroundColor = color;
|
Console.ForegroundColor = color;
|
||||||
|
@ -469,11 +469,30 @@ namespace DCFApixels.DragonECS
|
|||||||
{
|
{
|
||||||
list.Clear();
|
list.Clear();
|
||||||
var itemsCount = GetComponentsCount(entityID);
|
var itemsCount = GetComponentsCount(entityID);
|
||||||
|
for (var i = 0; i < _poolsCount; i++)
|
||||||
for (var i = 0; i < _pools.Length; i++)
|
|
||||||
{
|
{
|
||||||
if (_pools[i].Has(entityID))
|
if (_pools[i].Has(entityID))
|
||||||
|
{
|
||||||
|
itemsCount--;
|
||||||
list.Add(_pools[i].GetRaw(entityID));
|
list.Add(_pools[i].GetRaw(entityID));
|
||||||
|
if (itemsCount <= 0)
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public void GetComponentTypes(int entityID, HashSet<Type> typeSet)
|
||||||
|
{
|
||||||
|
typeSet.Clear();
|
||||||
|
var itemsCount = GetComponentsCount(entityID);
|
||||||
|
for (var i = 0; i < _poolsCount; i++)
|
||||||
|
{
|
||||||
|
if (_pools[i].Has(entityID))
|
||||||
|
{
|
||||||
|
itemsCount--;
|
||||||
|
typeSet.Add(_pools[i].ComponentType);
|
||||||
|
if (itemsCount <= 0)
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
|
Loading…
Reference in New Issue
Block a user