Handle C++ bracket default values for code gen to C#
This commit is contained in:
@@ -153,6 +153,17 @@ namespace Flax.Build.Bindings
|
|||||||
case "false": return value;
|
case "false": return value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Handle C++ bracket default values that are not arrays
|
||||||
|
if (value.StartsWith("{") && value.EndsWith("}") && valueType != null && !valueType.IsArray && valueType.Type != "Array")
|
||||||
|
{
|
||||||
|
value = value.Replace("{", "").Replace("}", "").Trim();
|
||||||
|
if (string.IsNullOrEmpty(value))
|
||||||
|
{
|
||||||
|
value = $"default({valueType.Type})";
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Numbers
|
// Numbers
|
||||||
if (float.TryParse(value, out _) || (value[value.Length - 1] == 'f' && float.TryParse(value.Substring(0, value.Length - 1), out _)))
|
if (float.TryParse(value, out _) || (value[value.Length - 1] == 'f' && float.TryParse(value.Substring(0, value.Length - 1), out _)))
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user