You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-07 12:30:27 +00:00
[.NET] Disallow [ExportToolButton] on members thay may store the Callable
Ensures the user doesn't store the Callable so the .NET assembly can be reloaded.
This commit is contained in:
@@ -4,5 +4,5 @@ using Godot.Collections;
|
||||
public partial class ExportDiagnostics_GD0108 : Node
|
||||
{
|
||||
[ExportToolButton("")]
|
||||
public Callable {|GD0108:MyButton|};
|
||||
public Callable {|GD0108:MyButton|} => new Callable();
|
||||
}
|
||||
|
||||
@@ -5,5 +5,5 @@ using Godot.Collections;
|
||||
public partial class ExportDiagnostics_GD0109 : Node
|
||||
{
|
||||
[Export, ExportToolButton("")]
|
||||
public Callable {|GD0109:MyButton|};
|
||||
public Callable {|GD0109:MyButton|} => new Callable();
|
||||
}
|
||||
|
||||
@@ -5,5 +5,5 @@ using Godot.Collections;
|
||||
public partial class ExportDiagnostics_GD0110 : Node
|
||||
{
|
||||
[ExportToolButton("")]
|
||||
public string {|GD0110:MyButton|};
|
||||
public int {|GD0110:MyButton|} => new();
|
||||
}
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
using Godot;
|
||||
using Godot.Collections;
|
||||
|
||||
[Tool]
|
||||
public partial class ExportDiagnostics_GD0111 : Node
|
||||
{
|
||||
private Callable _backingField;
|
||||
|
||||
[ExportToolButton("")]
|
||||
public Callable {|GD0111:MyButtonGet|} { get; }
|
||||
|
||||
[ExportToolButton("")]
|
||||
public Callable {|GD0111:MyButtonGetSet|} { get; set; }
|
||||
|
||||
[ExportToolButton("")]
|
||||
public Callable {|GD0111:MyButtonGetWithBackingField|} { get => _backingField; }
|
||||
|
||||
[ExportToolButton("")]
|
||||
public Callable {|GD0111:MyButtonGetSetWithBackingField|} { get => _backingField; set => _backingField = value; }
|
||||
|
||||
[ExportToolButton("")]
|
||||
public Callable MyButtonOkWithCallableCreationExpression => new Callable(this, "");
|
||||
|
||||
[ExportToolButton("")]
|
||||
public Callable MyButtonOkWithImplicitCallableCreationExpression => new(this, "");
|
||||
|
||||
[ExportToolButton("")]
|
||||
public Callable MyButtonOkWithCallableFromExpression => Callable.From(null);
|
||||
}
|
||||
Reference in New Issue
Block a user