From fc4c2c53fc5e9da86f3e2f9d2176a8f623d32474 Mon Sep 17 00:00:00 2001 From: Chandler Cox Date: Sun, 26 Jan 2025 13:50:07 -0600 Subject: [PATCH] select parent of prefab if it has a prefab link. --- Source/Editor/Viewport/MainEditorGizmoViewport.cs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Source/Editor/Viewport/MainEditorGizmoViewport.cs b/Source/Editor/Viewport/MainEditorGizmoViewport.cs index 44952bf92..a6d5f1c36 100644 --- a/Source/Editor/Viewport/MainEditorGizmoViewport.cs +++ b/Source/Editor/Viewport/MainEditorGizmoViewport.cs @@ -658,7 +658,7 @@ namespace FlaxEditor.Viewport if (ViewFrustum.Contains(actorBox) == ContainmentType.Disjoint) continue; - // Check is control and skip if canvas is 2D + // Check if control and skip if canvas is 2D if (a is UIControl control) { UICanvas canvas = null; @@ -700,7 +700,10 @@ namespace FlaxEditor.Viewport if (containsAllCorners) { - hits.Add(SceneGraphRoot.Find(a)); + if (a.HasPrefabLink) + hits.Add(SceneGraphRoot.Find(a.GetPrefabRoot())); + else + hits.Add(SceneGraphRoot.Find(a)); } }