Index of every page on this site: llms.txt
All skills
jame581 avatar

/csharp-signals

@426e8ab
by Jan Mesarčjame581/godotprompter979 stars
63
Run it yourself

Use when implementing signals in C# — [Signal] delegates, EmitSignal patterns, and async signal awaiting. Triggers on declaring, emitting, connecting, or awaiting a signal from a C# script, and on a signal crossing between C# and GDScript in either direction.

Use this Skill: https://skilld.dev/gh/jame581/godotprompter/csharp-signals

Nothing lands on disk. Nothing to clean up.

Fork this Skill

Edit a local copy. It keeps the author and licence.

referencesconnecting-gdscript-signals.md

≈443 tokens on demand. Your agent reads this file only when SKILL.md points to it.

Connecting GDScript Signals from C#

Reference for skills/csharp-signals/SKILL.md — bridging C# code to signals declared in GDScript nodes via Connect with string names.

← Back to SKILL.md


7. Connecting GDScript Signals from C#

When a GDScript node emits a signal and a C# node needs to subscribe, use the string-based Connect() API with Callable.From() to wrap the C# method.

using Godot;

public partial class ScoreDisplay : Label
{
    // Assume ScoreManager is a GDScript autoload with signal "score_changed(new_score: int)".
    private Node _scoreManager;

    public override void _Ready()
    {
        _scoreManager = GetNode("/root/ScoreManager");

        // Connect using the GDScript signal name (snake_case, as declared in GDScript).
        _scoreManager.Connect("score_changed", Callable.From<int>(OnScoreChanged));
    }

    public override void _ExitTree()
    {
        if (IsInstanceValid(_scoreManager))
            _scoreManager.Disconnect("score_changed", Callable.From<int>(OnScoreChanged));
    }

    private void OnScoreChanged(int newScore)
    {
        Text = $"Score: {newScore}";
    }
}

Important: Callable.From<T>() must match the signal parameter signature exactly. Use the GDScript snake_case signal name as a plain string — there is no SignalName constant for GDScript-declared signals on the C# side.

For signals with multiple parameters, use the overloads:

// GDScript signal: signal health_changed(current: int, maximum: int)
_player.Connect("health_changed", Callable.From<int, int>(OnHealthChanged));

// GDScript signal: signal item_collected(item_name: String)
_player.Connect("item_collected", Callable.From<string>(OnItemCollected));

Source: SKILL.md on GitHub

No rule matched.

skilld matched fixed text patterns in SKILL.md and file names. Patterns miss obfuscated code.

skilld run checks every file with the same patterns. It asks for approval before it loads a Skill with a behavior marked Needs approval.

No alerts7d3 checks · Risk SAFE
  • Gen Agent Trust Hub7d

    The skill provides safe documentation and code templates for implementing Godot 4.x signals in C#. No malicious patterns, obfuscation, or data exfiltration risks were detected.

  • Socket7d

    No alerts

  • Snyk7d

    Risk: LOW · No issues

Signed by skilld at 426e8ab. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub 6 days ago.

Activeupdated last week

README badge

README badge for jame581/godotprompter/csharp-signals