You have two methods to obtain UnrealSharp’s dependency packages:
- Download the precompiled .NET 8.0 runtime binary package:
From GoogleDrive
From BaiduDisk - Build it by yourself
Although the design of UnrealSharp does not mandate the use of .NET's underlying runtime type, it currently only implements a Mono-based Runtime, so the mono runtime must be selected when compiling .net. Runtime based on CoreCLR will be provided in subsequent development
.NET runtime build workflow
Building Mono
clone .NET runtime source code(UnrealSharp fork)
To build a complete runtime environment, you need to build both the Mono runtime and libraries. At the repo root, simply execute:
./build.sh mono+libs
or on Windows,
build.cmd mono+libs
Note that the debug configuration is the default option. It generates a 'debug' output and that includes asserts, fewer code optimizations, and is easier for debugging. If you want to make performance measurements, or just want tests to execute more quickly, you can also build the 'release' version which does not have these checks by adding the flag -configuration release
(or -c release
).
If you want to compile libraries for other architectures on the current platform, you can use the command line -a:
./build.sh mono+libs -a arm64 -c release
You can use -help to see the full list of supported commands:
./build.sh -help
After compilation is completed, you will see the directory artifacts/bin in the runtime source code root directory. There will be two directories in this directory, mono and runtime, which UnrealSharp depends on.
- runtime
- artifacts
- bin
- mono
- ios.arm64.Debug
- ios.arm64.Release
- osx.arm64.Debug
- osx.arm64.Release
- osx.x64.Debug
- osx.x64.Release
- windows.x64.Debug
- ...
- runtime
- net8.0-ios-Debug-arm64
- net8.0-ios-Release-arm64
- net8.0-osx-Debug-arm64
- ...
- mono
- bin
- artifacts
The specific subfolders depend on your compilation platform and compilation configuration.
Copy the entire mono and runtime directories to the Plugins/UnrealSharp/ThirdParty directory in the root directory of your Unreal project.
Your final directory should look like this:
- Your Unreal Project
- Plugins
- UnrealSharp
- ThirdParty
- mono
- windows.x64.Debug
- ...
- runtime
- net8.0-windows-Debug-x64
- ...
- mono
- ThirdParty
- UnrealSharp
- GameScripts
- Managed
- Plugins