GodotPublicSignalPublisherGenerator 1.0.9

dotnet add package GodotPublicSignalPublisherGenerator --version 1.0.9
                    
NuGet\Install-Package GodotPublicSignalPublisherGenerator -Version 1.0.9
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="GodotPublicSignalPublisherGenerator" Version="1.0.9">
  <PrivateAssets>all</PrivateAssets>
  <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="GodotPublicSignalPublisherGenerator" Version="1.0.9" />
                    
Directory.Packages.props
<PackageReference Include="GodotPublicSignalPublisherGenerator">
  <PrivateAssets>all</PrivateAssets>
  <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add GodotPublicSignalPublisherGenerator --version 1.0.9
                    
#r "nuget: GodotPublicSignalPublisherGenerator, 1.0.9"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package GodotPublicSignalPublisherGenerator@1.0.9
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=GodotPublicSignalPublisherGenerator&version=1.0.9
                    
Install as a Cake Addin
#tool nuget:?package=GodotPublicSignalPublisherGenerator&version=1.0.9
                    
Install as a Cake Tool

Godot Public Signal Publisher Generator

A C# source generator that automatically creates public emission methods for public Godot signals in your code.

Purpose

This source generator simplifies signal emission in Godot by automatically generating public SignalEmit methods for your signals. Instead of using the generic EmitSignal method, you get strongly-typed methods specific to each signal.

Requirements

  • .NET 6.0 or later
  • Godot 4.0 or later

Installation

Install the NuGet package in your Godot project:

dotnet add package GodotPublicSignalPublisherGenerator

Usage

  1. Define your signals using public delegates with the [Signal] attribute
  2. Make sure your class is partial
  3. The generator will automatically create corresponding SignalEmit methods

Example

public partial class YourNode : Node
{
    // Define your signal
    [Signal]
    public delegate void HealthChangedEventHandler(int oldHealth, int newHealth);
    
    private int _health = 100;
    
    public void TakeDamage(int damage)
    {
        var oldHealth = _health;
        _health -= damage;
        // Use the generated method
        SignalEmitHealthChanged(oldHealth, _health);
    }
}

The source generator will automatically create:

public partial class YourNode
{
    public void SignalEmitHealthChanged(int oldHealth, int newHealth) 
    {
        EmitSignal(SignalName.HealthChanged, oldHealth, newHealth);
    }
}

Naming Convention

  • Your signal delegate names must end with EventHandler
  • The generated emission methods will be named SignalEmit followed by the signal name (without the EventHandler suffix)

Features

  • Strongly-typed signal emission methods
  • Compile-time validation
  • Clean and intuitive API
  • Supports all Godot-compatible parameter types
  • Works with nested partial classes

License

This project is licensed under the MIT License - see the LICENSE file for details.

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

Product Compatible and additional computed target framework versions.
.NET net6.0 is compatible.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net6.0

    • No dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.9 65 6/27/2025
1.0.8 170 5/1/2025 1.0.8 is deprecated.