From f7ea45b14d3b080463478a8b0903e7f5cc444897 Mon Sep 17 00:00:00 2001 From: Chandler Cox Date: Fri, 6 Sep 2024 16:10:35 -0500 Subject: [PATCH] Fix interface bindings clashing namespace and class name if class has same name as namespace. --- .../Tools/Flax.Build/Bindings/BindingsGenerator.CSharp.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Source/Tools/Flax.Build/Bindings/BindingsGenerator.CSharp.cs b/Source/Tools/Flax.Build/Bindings/BindingsGenerator.CSharp.cs index a972f1b78..5d0297991 100644 --- a/Source/Tools/Flax.Build/Bindings/BindingsGenerator.CSharp.cs +++ b/Source/Tools/Flax.Build/Bindings/BindingsGenerator.CSharp.cs @@ -530,7 +530,7 @@ namespace Flax.Build.Bindings // interface if (apiType.IsInterface) - return string.Format("FlaxEngine.Object.GetUnmanagedInterface({{0}}, typeof({0}))", apiType.FullNameManaged); + return string.Format("FlaxEngine.Object.GetUnmanagedInterface({{0}}, typeof({0}))", apiType.Name); } // Object reference property @@ -590,7 +590,7 @@ namespace Flax.Build.Bindings fullReturnValueType = $"{apiType.Namespace}.Interop.{returnValueType}"; // Interfaces are not supported by NativeMarshallingAttribute, marshal the parameter - returnMarshalType = $"MarshalUsing(typeof({fullReturnValueType}Marshaller))"; + returnMarshalType = $"MarshalUsing(typeof({returnValueType}Marshaller))"; } else if (functionInfo.ReturnType.Type == "MonoArray" || functionInfo.ReturnType.Type == "MArray") returnMarshalType = "MarshalUsing(typeof(FlaxEngine.Interop.SystemArrayMarshaller))"; @@ -2189,7 +2189,7 @@ namespace Flax.Build.Bindings contents.Append(indent).AppendLine("/// "); if (buildData.Target != null & buildData.Target.IsEditor) contents.Append(indent).AppendLine("[HideInEditor]"); - contents.Append(indent).AppendLine($"[CustomMarshaller(typeof({interfaceInfo.Name}), MarshalMode.Default, typeof({marshallerFullName}))]"); + contents.Append(indent).AppendLine($"[CustomMarshaller(typeof({interfaceInfo.Name}), MarshalMode.Default, typeof({marshallerName}))]"); contents.Append(indent).AppendLine($"public static class {marshallerName}"); contents.Append(indent).AppendLine("{"); contents.AppendLine("#pragma warning disable 1591");