add deep debug for GetMeta

This commit is contained in:
DCFApixels 2025-03-23 21:12:58 +08:00
parent 3e59e7a5bd
commit dd8b126c27

View File

@ -1,6 +1,7 @@
#if DISABLE_DEBUG #if DISABLE_DEBUG
#undef DEBUG #undef DEBUG
#endif #endif
using DCFApixels.DragonECS.Internal;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
#if DEBUG || !REFLECTION_DISABLED #if DEBUG || !REFLECTION_DISABLED
@ -312,6 +313,9 @@ namespace DCFApixels.DragonECS
{ {
public static TypeMeta GetMeta(this object self) public static TypeMeta GetMeta(this object self)
{ {
#if DEBUG && DRAGONECS_DEEP_DEBUG
if (self is Type type) { Throw.DeepDebugException(); }
#endif
return EcsDebugUtility.GetTypeMeta(self); return EcsDebugUtility.GetTypeMeta(self);
} }
public static TypeMeta ToMeta(this Type self) public static TypeMeta ToMeta(this Type self)