1.3 KiB
1.3 KiB
Generating C# Bindings
C# Bindings need to be rebuilt after building Terrain3D. At this point in time, C# and GDScript don't share their ClassDB. You can call the functions through reflection, but providing C# Bindings makes coding in C# much easier. As of Terrain3D 1.1, these bindings are generated and included in release builds by a maintainer.
How To Generate Bindings
- Compile Terrain3D as shown in Building from Source.
- Clone the CSharp-Wrapper-Generator-for-GDExtension repo.
- Load the CSharp Wrapper Generator project in the .NET version of Godot.
- Build the C# project.
- Ensure the plugin is enabled in project settings and restart.
- You should see a Wrapper Generator panel in a side panel. Set up the namespace
TokisanGames, save pathaddons/terrain_3d/csharp, and indentationtabs. - Add your built
addons/terrain_3d/folder to this project. I made a link on my filesystem between my Terrain3D repo and this one so I could read from new builds, and generate C# without moving files. - Generate, and look for errors or warnings to address.
- Move the generated C# files to
project/addons/terrain_3d/csharpin your project. - In your project, build the C# project.