Various fixes for scripting bindings codegen

This commit is contained in:
Wojtek Figat
2023-08-19 17:00:05 +02:00
parent e36bf6e19a
commit de6254b5a5
2 changed files with 12 additions and 3 deletions

View File

@@ -375,6 +375,13 @@ namespace Flax.Build.Bindings
// Find API type info
var apiType = FindApiTypeInfo(buildData, typeInfo, caller);
var typeName = typeInfo.Type.Replace("::", ".");
if (typeInfo.GenericArgs != null)
{
typeName += '<';
foreach (var arg in typeInfo.GenericArgs)
typeName += arg.Type.Replace("::", ".");
typeName += '>';
}
if (apiType != null)
{
// Add reference to the namespace
@@ -1320,7 +1327,7 @@ namespace Flax.Build.Bindings
contents.AppendLine(string.Join("\n" + indent, (indent + $$"""
/// <summary>
/// Marshaller for type <see cref="{{classInfo.Name}}"/>.
/// </summary>");
/// </summary>
#if FLAX_EDITOR
[HideInEditor]
#endif

View File

@@ -849,14 +849,12 @@ namespace Flax.Build.Bindings
if (typeInfo.GenericArgs != null)
{
type += '<';
for (var i = 0; i < typeInfo.GenericArgs.Count; i++)
{
if (i != 0)
type += ", ";
type += typeInfo.GenericArgs[i];
}
type += '>';
}
return string.Empty;
@@ -1074,6 +1072,10 @@ namespace Flax.Build.Bindings
{
convertOutputParameter = true;
}
else if (apiType.Name == "Variant")
{
convertOutputParameter = true;
}
}
// BytesContainer
else if (parameterInfo.Type.Type == "BytesContainer" && parameterInfo.Type.GenericArgs == null)