GDBridge 0.9.0

dotnet add package GDBridge --version 0.9.0
NuGet\Install-Package GDBridge -Version 0.9.0
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="GDBridge" Version="0.9.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add GDBridge --version 0.9.0
#r "nuget: GDBridge, 0.9.0"
#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.
// Install GDBridge as a Cake Addin
#addin nuget:?package=GDBridge&version=0.9.0

// Install GDBridge as a Cake Tool
#tool nuget:?package=GDBridge&version=0.9.0

Test

GDBridge

⚠In active developement

Some thing can change but not that much.

Simple package to simplify C# → GDScript interoperability.
It comes in two part the bridge code and the source generator.
The generator will parse all the GDScript in the project and generate a C# GDBridge class for each of them.
It aims to reduce or remove the need to use string and untyped way of communicating with GDScript from C#.

Get it here → https://www.nuget.org/packages/GDBridge and here → https://www.nuget.org/packages/GDBridge.Generator

Feature

  • Call GDScript from C#.
  • Use your C# class in the generated code(Even the bridge themselve).
  • Respect the _private method and field.
  • Configurable.
  • Use root namespace as default.
  • Signal support.
  • GodotObject support. And more to come.

How to use(See Sample)

Make sure to instal both GDBridge and GDBridge.Generator.
Only script with class_name will be bridged.
Variable and function starting with _ are not expose in the bridge by default.

Add this to your .csproj:

  <ItemGroup>
    <AdditionalFiles Include="**/*.gd"/>
    
    
  </ItemGroup>
using GdBridge;

var myGDScript = new GdScriptBridgeFactory(this).ResolveNode<ArenaBridge>(arena);

myGDScript.on_configure(42);

The bridge class is partial, so you can extend it if needed.
The bridge class is in the global namespace.
You can extend it like this:

partial class ArenaBridge
{
    public void DoSomethingElse(int deckId) => on_configure(deckId);
}

How to configure(Optional)

Create the GDBridgeConfiguration.json in the root directory and add this to it:

{
    "UsePascalCase": true
}

The schema is here: Configuration.cs

Feel free to ask for feature or question.

What do you want?

Pull Request are welcome.
Product Compatible and additional computed target framework versions.
.NET net7.0 is compatible.  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. 
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.9.0 244 11/21/2023
0.8.0 115 9/18/2023
0.7.0 113 9/15/2023
0.6.0 124 9/14/2023
0.5.0 102 9/14/2023
0.4.0 101 9/13/2023
0.3.0 89 9/13/2023
0.2.0 98 9/13/2023
0.1.0 111 9/13/2023