Allow Scripting Object as BT blackboard but don't support plain classes

This commit is contained in:
Wojtek Figat
2023-08-17 15:29:00 +02:00
parent 5f79fdd5f9
commit c15a48b0b4

View File

@@ -16,7 +16,7 @@ namespace FlaxEngine
#if FLAX_EDITOR #if FLAX_EDITOR
private static bool IsValidBlackboardType(ScriptType type) private static bool IsValidBlackboardType(ScriptType type)
{ {
if (ScriptType.FlaxObject.IsAssignableFrom(type)) if (new ScriptType(typeof(SceneObject)).IsAssignableFrom(type))
return false; return false;
if (type.Type != null) if (type.Type != null)
{ {
@@ -35,7 +35,7 @@ namespace FlaxEngine
!type.IsAbstract && !type.IsAbstract &&
!type.IsArray && !type.IsArray &&
!type.IsVoid && !type.IsVoid &&
(type.IsClass || type.IsStructure) && (type.IsStructure || ScriptType.FlaxObject.IsAssignableFrom(type)) &&
type.IsPublic && type.IsPublic &&
type.CanCreateInstance; type.CanCreateInstance;
} }