Blacklist various std lib namespaces in Visual Scripting

This commit is contained in:
Wojtek Figat
2024-09-17 00:14:43 +02:00
parent dcadb11a20
commit f050621e3e

View File

@@ -35,6 +35,14 @@ namespace FlaxEditor.Surface
Archetypes = new List<NodeArchetype>(),
};
private static readonly string[] _blacklistedTypeNames =
{
"Newtonsoft.Json.",
"System.Array",
"System.Linq.Expressions.",
"System.Reflection.",
};
private static NodesCache _nodesCache = new NodesCache(IterateNodesCache);
private DragActors _dragActors;
@@ -268,8 +276,11 @@ namespace FlaxEditor.Surface
{
// Skip Newtonsoft.Json stuff
var scriptTypeTypeName = scriptType.TypeName;
if (scriptTypeTypeName.StartsWith("Newtonsoft.Json."))
return;
for (var i = 0; i < _blacklistedTypeNames.Length; i++)
{
if (scriptTypeTypeName.StartsWith(_blacklistedTypeNames[i]))
return;
}
var scriptTypeName = scriptType.Name;
// Enum