diff --git a/Source/Editor/Modules/SourceCodeEditing/CodeEditingModule.cs b/Source/Editor/Modules/SourceCodeEditing/CodeEditingModule.cs index 1e7583dbe..ce82c1f9d 100644 --- a/Source/Editor/Modules/SourceCodeEditing/CodeEditingModule.cs +++ b/Source/Editor/Modules/SourceCodeEditing/CodeEditingModule.cs @@ -26,7 +26,11 @@ namespace FlaxEditor.Modules.SourceCodeEditing private static bool CheckFunc(ScriptType scriptType) { - if (scriptType.IsStatic || scriptType.IsGenericType || !scriptType.IsPublic || scriptType.HasAttribute(typeof(HideInEditorAttribute), true)) + if (scriptType.IsStatic || + scriptType.IsGenericType || + !scriptType.IsPublic || + scriptType.HasAttribute(typeof(HideInEditorAttribute), true) || + scriptType.HasAttribute(typeof(System.Runtime.CompilerServices.CompilerGeneratedAttribute), false)) return false; var managedType = TypeUtils.GetType(scriptType); return !TypeUtils.IsDelegate(managedType); diff --git a/Source/Editor/Surface/SurfaceUtils.cs b/Source/Editor/Surface/SurfaceUtils.cs index d4a526687..144147f71 100644 --- a/Source/Editor/Surface/SurfaceUtils.cs +++ b/Source/Editor/Surface/SurfaceUtils.cs @@ -405,7 +405,9 @@ namespace FlaxEditor.Surface internal static bool IsValidVisualScriptType(ScriptType scriptType) { - if (!scriptType.IsPublic || scriptType.HasAttribute(typeof(HideInEditorAttribute), true)) + if (!scriptType.IsPublic || + scriptType.HasAttribute(typeof(HideInEditorAttribute), true) || + scriptType.HasAttribute(typeof(System.Runtime.CompilerServices.CompilerGeneratedAttribute), false)) return false; if (scriptType.IsGenericType) { diff --git a/Source/Tools/Flax.Build/Bindings/BindingsGenerator.CSharp.cs b/Source/Tools/Flax.Build/Bindings/BindingsGenerator.CSharp.cs index 64cd3683f..389d6815f 100644 --- a/Source/Tools/Flax.Build/Bindings/BindingsGenerator.CSharp.cs +++ b/Source/Tools/Flax.Build/Bindings/BindingsGenerator.CSharp.cs @@ -1271,6 +1271,7 @@ namespace Flax.Build.Bindings public static IntPtr ConvertToUnmanaged({{classInfo.Name}} managed) => GCHandleMarshaller.ManagedToNative.ConvertToUnmanaged(managed); public static void Free(IntPtr unmanaged) => GCHandleMarshaller.ManagedToNative.Free(unmanaged); } + [HideInEditor] public struct Bidirectional { GCHandleMarshaller.Bidirectional marsh; @@ -1342,9 +1343,9 @@ namespace Flax.Build.Bindings { // Native struct begin GenerateCSharpAttributes(buildData, contents, indent, structureInfo, true); + contents.Append(indent).AppendLine("[HideInEditor]"); contents.Append(indent).AppendLine("[StructLayout(LayoutKind.Sequential)]"); - contents.Append(indent); - contents.Append("public struct ").Append(structureInfo.Name).Append("Internal"); + contents.Append(indent).Append("public struct ").Append(structureInfo.Name).Append("Internal"); if (structureInfo.BaseType != null && structureInfo.IsPod) contents.Append(" : ").Append(GenerateCSharpNativeToManaged(buildData, new TypeInfo { Type = structureInfo.BaseType.Name }, structureInfo)); contents.AppendLine(); @@ -1595,6 +1596,7 @@ namespace Flax.Build.Bindings // Bidirectional stateful shape // NOTE: GCHandles of FlaxEngine.Object must not be released unless they were allocated by this marshaller + contents.Append(indent).AppendLine("[HideInEditor]"); contents.Append(indent).AppendLine($"public struct Bidirectional").Append(indent).AppendLine("{"); contents.Append(indent2).AppendLine($"{structureInfo.Name} managed;"); contents.Append(indent2).AppendLine($"{structureInfo.Name}Internal unmanaged;");