diff options
author | Ignacio Roldán Etcheverry <ignalfonsore@gmail.com> | 2022-07-28 17:41:47 +0200 |
---|---|---|
committer | Ignacio Roldán Etcheverry <ignalfonsore@gmail.com> | 2022-08-22 03:36:52 +0200 |
commit | 97713ff77a339faa72d54bd596e3d8c2b8520ce0 (patch) | |
tree | 22e97aa97c7ff55d5e3cd92c3cc4130a041aa6ef /modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators.Sample | |
parent | f033764ffe5892f963a9416e8cbcfd0fb5225103 (diff) |
C#: Add source generator for signals as events
Changed the signal declaration signal to:
```
// The following generates a MySignal event
[Signal] public delegate void MySignalEventHandler(int param);
```
Diffstat (limited to 'modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators.Sample')
-rw-r--r-- | modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators.Sample/EventSignals.cs | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators.Sample/EventSignals.cs b/modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators.Sample/EventSignals.cs new file mode 100644 index 0000000000..764ba8f121 --- /dev/null +++ b/modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators.Sample/EventSignals.cs @@ -0,0 +1,7 @@ +namespace Godot.SourceGenerators.Sample; + +public partial class EventSignals : Godot.Object +{ + [Signal] + public delegate void MySignalEventHandler(string str, int num); +} |