Ignacio Roldán Etcheverry ec521a405a Merge pull request #68253 from dzil123/fix_array_shuffle il y a 3 ans
..
build_scripts 340f62d1ec .NET: Generate SdkPackageVersions.props from version.py il y a 3 ans
doc_classes f9a67ee9da C#: Begin move to .NET Core il y a 3 ans
editor 5947f22be9 Merge pull request #67578 from KoBeWi/GEDITOR il y a 3 ans
glue ec521a405a Merge pull request #68253 from dzil123/fix_array_shuffle il y a 3 ans
icons a1d9c67f43 Optimize SVG using `svgcleaner --multipass` il y a 5 ans
mono_gd 282bd37e5c C#: Remove need for reflection to invoking callable delegates il y a 3 ans
thirdparty f784fb2000 C#: Replace libnethost dependency to find hostfxr il y a 3 ans
utils 49fcf4ffad Style: Cleanup header guards for consistency il y a 3 ans
.editorconfig e5e7a795b1 C#: Code cleanup and greatly reduce use of C# pointers il y a 3 ans
.gitignore 340f62d1ec .NET: Generate SdkPackageVersions.props from version.py il y a 3 ans
Directory.Build.props d78e0a8426 C#: Make GodotSharp API a NuGet package il y a 3 ans
Directory.Build.targets fbea89d4f1 C#: Generate symbols packages il y a 3 ans
README.md c71b78bbb8 Add float arg to build_assemblies.py il y a 3 ans
SCsub 39facb35a0 SCons: Unify tools/target build type configuration il y a 3 ans
__init__.py 270af6fa08 Re-write mono module editor code in C# il y a 6 ans
class_db_api_json.cpp fe56c1ff75 Use `JSON::stringify` where possible il y a 3 ans
class_db_api_json.h fe52458154 Update copyright statements to 2022 il y a 4 ans
config.py 39facb35a0 SCons: Unify tools/target build type configuration il y a 3 ans
csharp_script.cpp 5bf95518fd GDScript/C#: Tweak error message for invalid script type for object il y a 3 ans
csharp_script.h 82b87d7a17 Remove unsupported `NO_SAFE_CAST`/`-fno-rtti` from Android build il y a 3 ans
godotsharp_defs.h f88d8902cf C#: Ensure native handles are freed after switch to .NET Core il y a 3 ans
godotsharp_dirs.cpp e48c5daddf Unify usage of GLOBAL/EDITOR_GET il y a 3 ans
godotsharp_dirs.h 6daf4c6593 [.NET Export] Improve .NET export process. il y a 3 ans
interop_types.h 124fbf95f8 C#: Move marshaling logic and generated glue to C# il y a 3 ans
managed_callable.cpp 282bd37e5c C#: Remove need for reflection to invoking callable delegates il y a 3 ans
managed_callable.h 282bd37e5c C#: Remove need for reflection to invoking callable delegates il y a 3 ans
mono_gc_handle.cpp f9a67ee9da C#: Begin move to .NET Core il y a 3 ans
mono_gc_handle.h 92503ae8db C#: Add source generator for properties and exports default values il y a 3 ans
register_types.cpp de0ca3b999 Refactor module initialization il y a 3 ans
register_types.h de0ca3b999 Refactor module initialization il y a 3 ans
signal_awaiter_utils.cpp dd26ecdd31 Rename CONNECT_ONESHOT TO CONNECT_ONE_SHOT il y a 3 ans
signal_awaiter_utils.h 513ee857a9 C#: Restructure code prior move to .NET Core il y a 3 ans

README.md

How to build and run

  1. Build Godot with the module enabled: module_mono_enabled=yes.
  2. After building Godot, use it to generate the C# glue code:

    <godot_binary> --generate-mono-glue ./modules/mono/glue
    
  3. Build the C# solutions:

    ./modules/mono/build_scripts/build_assemblies.py --godot-output-dir ./bin
    

The paths specified in these examples assume the command is being run from the Godot source root.

How to deal with NuGet packages

We distribute the API assemblies, our source generators, and our custom MSBuild project SDK as NuGet packages. This is all transparent to the user, but it can make things complicated during development.

In order to use Godot with a development of those packages, we must create a local NuGet source where MSBuild can find them. This can be done with the .NET CLI:

dotnet nuget add source ~/MyLocalNugetSource --name MyLocalNugetSource

The Godot NuGet packages must be added to that local source. Additionally, we must make sure there are no other versions of the package in the NuGet cache, as MSBuild may pick one of those instead.

In order to simplify this process, the build_assemblies.py script provides the following --push-nupkgs-local option:

./modules/mono/build_scripts/build_assemblies.py --godot-output-dir ./bin \
    --push-nupkgs-local ~/MyLocalNugetSource

This option ensures the packages will be added to the specified local NuGet source and that conflicting versions of the package are removed from the NuGet cache. It's recommended to always use this option when building the C# solutions during development to avoid mistakes.

Double Precision Support (REAL_T_IS_DOUBLE)

Follow the above instructions but build Godot with the float=64 argument to scons

When building the NuGet packages, specify --float=64 - for example:

./modules/mono/build_scripts/build_assemblies.py --godot-output-dir ./bin \
    --push-nupkgs-local ~/MyLocalNugetSource --float=64