LokiCat.PankuConsole.DotNet 0.0.10

The owner has unlisted this package. This could mean that the package is deprecated, has security vulnerabilities or shouldn't be used anymore.
dotnet add package LokiCat.PankuConsole.DotNet --version 0.0.10
                    
NuGet\Install-Package LokiCat.PankuConsole.DotNet -Version 0.0.10
                    
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="LokiCat.PankuConsole.DotNet" Version="0.0.10" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="LokiCat.PankuConsole.DotNet" Version="0.0.10" />
                    
Directory.Packages.props
<PackageReference Include="LokiCat.PankuConsole.DotNet" />
                    
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 LokiCat.PankuConsole.DotNet --version 0.0.10
                    
#r "nuget: LokiCat.PankuConsole.DotNet, 0.0.10"
                    
#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 LokiCat.PankuConsole.DotNet@0.0.10
                    
#: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=LokiCat.PankuConsole.DotNet&version=0.0.10
                    
Install as a Cake Addin
#tool nuget:?package=LokiCat.PankuConsole.DotNet&version=0.0.10
                    
Install as a Cake Tool

ConsoleCommandBridgeGenerator

A Roslyn incremental source generator that bridges C# methods to the PankuConsole in Godot via GDScript wrappers.

It automatically generates a ConsoleBridge.gd file with @panku_command functions, exposing decorated C# methods to the in-game developer console.


✨ Features

  • ✔️ Auto-generates @panku_command wrappers for [ConsoleCommand] methods
  • ✔️ Supports async methods (Task)
  • ✔️ Supports optional/default parameters with arity overloads
  • ✔️ Groups commands by class name using ClassName.MethodName()
  • ✔️ Emits PascalCase if custom name is given
  • ✔️ Self-contained — no need to define the attribute manually

🚀 Quick Start

  1. Install the generator (via NuGet or project reference)

  2. Add the attribute to your method:

public partial class PlayerDebug : Node {
  [ConsoleCommand] // exposed as: PlayerDebug.Kill()
  public void Kill(string reason = "test") => GD.Print(reason);
}
  1. Or override the name completely:
[ConsoleCommand("kill_now")] // exposed as: kill_now()
public void Kill(string reason = "test") => GD.Print(reason);
  1. Use it in Godot via PankuConsole:
> PlayerDebug.Kill("fall")
> kill_now("fall")

🧾 Command Name Mapping

C# Declaration Exposed Console Command
[ConsoleCommand] on PlayerDebug.Kill() PlayerDebug.Kill()
[ConsoleCommand("kill_now")] on PlayerDebug.Kill() kill_now()
[ConsoleCommand] on GameDebug.ResetGame() GameDebug.ResetGame()

📄 Generated Output

For [ConsoleCommand] method:

public class GameDebug : Node {
  [ConsoleCommand]
  public void ResetGame(int delay = 5) => GD.Print("Reset in", delay);
}

Generates GDScript:

@panku_command
func game_debug.ResetGame(delay: int):
    GameDebug.ResetGame(delay)

@panku_command
func game_debug.ResetGame():
    GameDebug.ResetGame(5)

🧐 Notes

  • Only methods on Node-derived types are supported
  • Custom command name disables grouping and uses it verbatim
  • All generated commands live in ConsoleBridge.gd

📦 Integration

Make sure ConsoleBridge.gd is added to your scene and ready at runtime. It will @onready bind to your C# nodes using the %NodeName syntax.


💪 License

MIT

There are no supported framework assets in this package.

Learn more about Target Frameworks and .NET Standard.

  • net7.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