Shaka.Godot.Actions 0.0.6

dotnet add package Shaka.Godot.Actions --version 0.0.6
                    
NuGet\Install-Package Shaka.Godot.Actions -Version 0.0.6
                    
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="Shaka.Godot.Actions" Version="0.0.6" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Shaka.Godot.Actions" Version="0.0.6" />
                    
Directory.Packages.props
<PackageReference Include="Shaka.Godot.Actions" />
                    
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 Shaka.Godot.Actions --version 0.0.6
                    
#r "nuget: Shaka.Godot.Actions, 0.0.6"
                    
#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 Shaka.Godot.Actions@0.0.6
                    
#: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=Shaka.Godot.Actions&version=0.0.6
                    
Install as a Cake Addin
#tool nuget:?package=Shaka.Godot.Actions&version=0.0.6
                    
Install as a Cake Tool

🎯 Shaka.Godot.OnReady

A C# Source Generator for Godot 4 .NET that automatically turns your input actions into compile-time safe static StringName.

✨ Benefits:

  • πŸ–± IDE Autocompletion for input actions.
  • πŸ”’ Compile-time safety: Your project won’t build if you rename actions in Godot but forget to update them in code.
  • ⚑ No runtime reflection β€” all generated at build time.

Example of generated code:

namespace MyGame;

internal static partial class Actions
{
    internal static Godot.StringName Quit = "quit";
}

πŸš€ Features

  • πŸ›‘ Compile-time safety for all input actions.
  • πŸ“œ Clean, readable generated code.
  • πŸ” LSP/IDE autocompletion in C# editors.
  • 🧩 Supports both custom and built-in Godot actions.
  • πŸ”§ Configurable namespace support.
  • πŸ“‚ Automatically reads project.godot to generate constants.

πŸ“¦ Installation

Add it to your Godot project via NuGet.
Since this is a source generator, make sure to include the PrivateAssets and IncludeAssets properties:

<PackageReference Include="Shaka.Godot.Actions" Version="x.x.x">
   <PrivateAssets>all</PrivateAssets>
   <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>

πŸ”— Check the NuGet package page for the latest version.

The generator will automatically read your project.godot file and generate a globally available static Actions class.


πŸ•Ή Usage

🎯 Custom Actions

If you define a custom action in Godot (e.g., quit), you can access it with MyGame.Actions.Quit:

public override void _Input(InputEvent @event)
{
    if (@event.IsActionPressed(MyGame.Actions.Quit))
    {
        Quit();
    }
}

βš™ Built-in Godot Actions

Godot’s default input actions are included under MyGame.Actions.Builtin.UIAccept:

public override void _Input(InputEvent @event)
{
    if (@event.IsActionPressed(MyGame.Actions.Builtin.UIAccept))
    {
        AcceptGift();
    }
}

βš™ Configuration

Actions Namespace

πŸ“Œ Default

By default, the generated Actions class is placed in the root namespace defined in your .csproj:

<PropertyGroup>
    <RootNamespace>MyGame</RootNamespace>
</PropertyGroup>

This means the class is accessible via:

MyGame.Actions

If no root namespace is defined, the namespace will default to the assembly name β€” typically your project name.

✏ Custom Namespace

If you don’t want the Actions class to be in the default namespace, override it by adding the SGActionsNamespace property:

<PropertyGroup>
    <SGActionsNamespace>MyActions</SGActionsNamespace>
</PropertyGroup>

The class will then be accessible via:

MyActions.Actions

πŸ’‘ Tip: This is useful if you want to group input actions into a dedicated namespace to avoid cluttering your main game namespace.


🀝 Contributing

Pull requests are welcome!
If you have ideas for new features, bug fixes, or improvements, feel free to open an issue or PR.


πŸ“œ License

This project is licensed under the MIT License β€” see the LICENSE file for details.

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  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. 
.NET Core netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.1 is compatible. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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
0.0.6 135 8/14/2025
0.0.5 132 8/13/2025
0.0.4 130 8/13/2025