Fix using nested types in Visual Script

This commit is contained in:
Wojtek Figat
2021-06-30 10:34:36 +02:00
parent 2b891483a5
commit bdefa77226
3 changed files with 3 additions and 3 deletions

View File

@@ -25,7 +25,7 @@ namespace FlaxEditor.Content.Create
private static bool IsValid(Type type)
{
return type.IsPublic && !type.IsSealed && !type.IsGenericType;
return (type.IsPublic || type.IsNestedPublic) && !type.IsSealed && !type.IsGenericType;
}
}

View File

@@ -748,7 +748,7 @@ namespace FlaxEditor.Scripting
/// <summary>
/// Gets a value indicating whether the type is declared public.
/// </summary>
public bool IsPublic => _managed != null ? _managed.IsPublic : _custom != null && _custom.IsPublic;
public bool IsPublic => _managed != null ? _managed.IsPublic || _managed.IsNestedPublic : _custom != null && _custom.IsPublic;
/// <summary>
/// Gets a value indicating whether the type is abstract and must be overridden.

View File

@@ -85,7 +85,7 @@ namespace FlaxEditor.Windows.Assets
private static bool IsValid(Type type)
{
return type.IsPublic && !type.IsSealed && !type.IsGenericType;
return (type.IsPublic || type.IsNestedPublic) && !type.IsSealed && !type.IsGenericType;
}
public void OnLoad(VisualScriptWindow window)