From 1196db6d178d3d2b3f0898216aed88ac4c8da3c9 Mon Sep 17 00:00:00 2001 From: Saas Date: Tue, 16 Sep 2025 22:54:57 +0200 Subject: [PATCH] check if control is control meant for gui editor use --- Source/Editor/Content/Create/PrefabCreateEntry.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Source/Editor/Content/Create/PrefabCreateEntry.cs b/Source/Editor/Content/Create/PrefabCreateEntry.cs index 90cca263d..34439a989 100644 --- a/Source/Editor/Content/Create/PrefabCreateEntry.cs +++ b/Source/Editor/Content/Create/PrefabCreateEntry.cs @@ -1,6 +1,7 @@ // Copyright (c) Wojciech Figat. All rights reserved. using System; +using System.Linq; using FlaxEditor.Scripting; using FlaxEngine; using FlaxEngine.GUI; @@ -117,7 +118,8 @@ namespace FlaxEditor.Content.Create private static bool IsValid(Type type) { - return (type.IsPublic || type.IsNestedPublic) && !type.IsAbstract && !type.IsGenericType; + var controlTypes = Editor.Instance.CodeEditing.Controls.Get(); + return (type.IsPublic || type.IsNestedPublic) && !type.IsAbstract && !type.IsGenericType && controlTypes.Any(c => c.Type == type); } }