diff --git a/Source/Editor/Viewport/PrefabWindowViewport.cs b/Source/Editor/Viewport/PrefabWindowViewport.cs index 4151e9dfb..f51abb1fc 100644 --- a/Source/Editor/Viewport/PrefabWindowViewport.cs +++ b/Source/Editor/Viewport/PrefabWindowViewport.cs @@ -623,6 +623,14 @@ namespace FlaxEditor.Viewport DebugDraw.DrawActors(new IntPtr(actors), _debugDrawData.ActorsCount, false); } } + + // Debug draw all actors in prefab + foreach (var child in SceneGraphRoot.ChildNodes) + { + if (child is not ActorNode actorNode) + continue; + DebugDraw.DrawActorsTree(actorNode.Actor); + } } } } diff --git a/Source/Engine/Debug/DebugDraw.cpp b/Source/Engine/Debug/DebugDraw.cpp index 1bb3a47f8..0bb97c0b2 100644 --- a/Source/Engine/Debug/DebugDraw.cpp +++ b/Source/Engine/Debug/DebugDraw.cpp @@ -944,6 +944,12 @@ void DebugDraw::DrawActors(Actor** selectedActors, int32 selectedActorsCount, bo } } +void DebugDraw::DrawActorsTree(Actor* actor) +{ + Function function = &DrawActorsTreeWalk; + actor->TreeExecute(function); +} + void DebugDraw::DrawAxisFromDirection(const Vector3& origin, const Vector3& direction, float size, float duration, bool depthTest) { ASSERT(direction.IsNormalized()); diff --git a/Source/Engine/Debug/DebugDraw.h b/Source/Engine/Debug/DebugDraw.h index 30e4c905f..ad5bd6fa1 100644 --- a/Source/Engine/Debug/DebugDraw.h +++ b/Source/Engine/Debug/DebugDraw.h @@ -67,6 +67,12 @@ API_CLASS(Static) class FLAXENGINE_API DebugDraw /// True if draw all debug shapes from scenes too or false if draw just from specified actor list. API_FUNCTION() static void DrawActors(Actor** selectedActors, int32 selectedActorsCount, bool drawScenes); + /// + /// Draws the debug shapes for the given actor and the actor's children + /// + /// /// The actor to start drawing at. + API_FUNCTION() static void DrawActorsTree(Actor* actor); + /// /// Draws the lines axis from direction. ///