Update RuntimeComponentsDrawer.cs

This commit is contained in:
DCFApixels 2025-05-09 22:18:23 +08:00
parent 236eb3d2bb
commit 09f7c6103d

View File

@ -247,12 +247,17 @@ namespace DCFApixels.DragonECS.Unity.Editors.X
} }
_runtimeComponentsDepth++; _runtimeComponentsDepth++;
_drawers[_runtimeComponentsDepth].DrawRuntimeComponents(entityID, world, isWithFoldout); try
_runtimeComponentsDepth--;
if (_runtimeComponentsDepth < RuntimeComponentsDepthRoot)
{ {
_runtimeComponentsDepth = RuntimeComponentsDepthRoot; _drawers[_runtimeComponentsDepth].DrawRuntimeComponents(entityID, world, isWithFoldout);
}
finally
{
_runtimeComponentsDepth--;
if (_runtimeComponentsDepth < RuntimeComponentsDepthRoot)
{
_runtimeComponentsDepth = RuntimeComponentsDepthRoot;
}
} }
} }
private void DrawRuntimeComponents(int entityID, EcsWorld world, bool isWithFoldout) private void DrawRuntimeComponents(int entityID, EcsWorld world, bool isWithFoldout)