1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-15 13:51:40 +00:00

fix https://github.com/godotengine/godot/issues/104135 Generator for C# makes illegal code for a GodotObject with a primary ctor

Co-authored-by: Raul Santos <raulsntos@gmail.com>
This commit is contained in:
Ivan Shakhov
2025-03-16 08:55:46 +01:00
committed by Ivan Shakhov
parent 49cc57a75d
commit 724c0021c7
4 changed files with 150 additions and 1 deletions

View File

@@ -0,0 +1,25 @@
partial class ExportedProperties2
{
#pragma warning disable CS0109 // Disable warning about redundant 'new' keyword
#if TOOLS
/// <summary>
/// Get the default values for all properties declared in this class.
/// This method is used by Godot to determine the value that will be
/// used by the inspector when resetting properties.
/// Do not call this method.
/// </summary>
[global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)]
internal new static global::System.Collections.Generic.Dictionary<global::Godot.StringName, global::Godot.Variant> GetGodotPropertyDefaultValues()
{
var values = new global::System.Collections.Generic.Dictionary<global::Godot.StringName, global::Godot.Variant>(3);
int __Health_default_value = default;
values.Add(PropertyName.@Health, global::Godot.Variant.From<int>(__Health_default_value));
global::Godot.Resource __SubResource_default_value = default;
values.Add(PropertyName.@SubResource, global::Godot.Variant.From<global::Godot.Resource>(__SubResource_default_value));
string[] __Strings_default_value = default;
values.Add(PropertyName.@Strings, global::Godot.Variant.From<string[]>(__Strings_default_value));
return values;
}
#endif // TOOLS
#pragma warning restore CS0109
}