check if control is control meant for gui editor use

This commit is contained in:
Saas
2025-09-16 22:54:57 +02:00
parent afdd264e63
commit 1196db6d17

View File

@@ -1,6 +1,7 @@
// Copyright (c) Wojciech Figat. All rights reserved. // Copyright (c) Wojciech Figat. All rights reserved.
using System; using System;
using System.Linq;
using FlaxEditor.Scripting; using FlaxEditor.Scripting;
using FlaxEngine; using FlaxEngine;
using FlaxEngine.GUI; using FlaxEngine.GUI;
@@ -117,7 +118,8 @@ namespace FlaxEditor.Content.Create
private static bool IsValid(Type type) 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);
} }
} }