refactoring/update debug utility

This commit is contained in:
Mikhail 2023-05-31 04:09:55 +08:00
parent 33f1f03294
commit 5f047a4507
2 changed files with 7 additions and 0 deletions

View File

@ -129,6 +129,7 @@ namespace DCFApixels.DragonECS
injectCallbacksRunner.OnPreInitInjectionAfter(); injectCallbacksRunner.OnPreInitInjectionAfter();
EcsRunner.Destroy(injectCallbacksRunner); EcsRunner.Destroy(injectCallbacksRunner);
} }
_injectedData = default;
} }
public void OnPreInitInjectionBefore() { } public void OnPreInitInjectionBefore() { }
public void OnPreInitInjectionAfter() => _injectController = null; public void OnPreInitInjectionAfter() => _injectController = null;

View File

@ -54,5 +54,11 @@ namespace DCFApixels.DragonECS
var atr = type.GetCustomAttribute<DebugColorAttribute>(); var atr = type.GetCustomAttribute<DebugColorAttribute>();
return atr != null ? (atr.r, atr.g, atr.b) : ((byte)255, (byte)255, (byte)255); return atr != null ? (atr.r, atr.g, atr.b) : ((byte)255, (byte)255, (byte)255);
} }
public static bool IsHidden<T>() => IsHidden(typeof(T));
public static bool IsHidden(Type type)
{
return type.GetCustomAttribute<DebugHideAttribute>() != null;
}
} }
} }