From 1196db6d178d3d2b3f0898216aed88ac4c8da3c9 Mon Sep 17 00:00:00 2001 From: Saas Date: Tue, 16 Sep 2025 22:54:57 +0200 Subject: [PATCH 1/2] 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); } } From 2604d5868754adfe73db5e60b245dc4138c622fe Mon Sep 17 00:00:00 2001 From: Saas Date: Thu, 18 Sep 2025 17:37:04 +0200 Subject: [PATCH 2/2] no more Linq --- Source/Editor/Content/Create/PrefabCreateEntry.cs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Source/Editor/Content/Create/PrefabCreateEntry.cs b/Source/Editor/Content/Create/PrefabCreateEntry.cs index 34439a989..e9ceaaa68 100644 --- a/Source/Editor/Content/Create/PrefabCreateEntry.cs +++ b/Source/Editor/Content/Create/PrefabCreateEntry.cs @@ -1,7 +1,6 @@ // Copyright (c) Wojciech Figat. All rights reserved. using System; -using System.Linq; using FlaxEditor.Scripting; using FlaxEngine; using FlaxEngine.GUI; @@ -119,7 +118,7 @@ namespace FlaxEditor.Content.Create private static bool IsValid(Type type) { var controlTypes = Editor.Instance.CodeEditing.Controls.Get(); - return (type.IsPublic || type.IsNestedPublic) && !type.IsAbstract && !type.IsGenericType && controlTypes.Any(c => c.Type == type); + return (type.IsPublic || type.IsNestedPublic) && !type.IsAbstract && !type.IsGenericType && controlTypes.Contains(new ScriptType(type)); } }