构建Godot引擎,Android,.NET(4.2)
2024年6月3日参考
环境准备
.NET, C++
通过Visual Studio安装.NET SDK或者按照官方文档的链接安装.NET SDK
C++可以通过Visual Studio安装
所以只要装一个VS就够了
Python – SCons
准备Python 3,并通过命令安装SCons
python -m pip install scons
获取代码
可以通过github获取godot代码
构建(普通版本)
editor
scons p=windows target=editor
export templates
scons p=windows target=template_debug arch=x86_64
scons p=windows target=template_release arch=x86_64
选项
lto=([none]|auto|thin|full)
optimize=(none|custom|debug|speed|[speed_trace]|size)
arch=([auto]|x86_32|x86_64|arm32|arm64|rv64|ppc32|ppc64|wasm32)
target=([editor]|template_release|template_debug)
production=(yes|[no])
构建(.NET)
editor
scons p=windows target=editor module_mono_enabled=yes
export templates
scons p=windows target=template_debug module_mono_enabled=yes
scons p=windows target=template_release module_mono_enabled=yes
Generate Glue
bin\godot.windows.editor.x86_64.mono.exe --headless --generate-mono-glue modules/mono/glue
Build .NET assemblies
./modules/mono/build_scripts/build_assemblies.py --godot-output-dir=./bin --godot-platform=windows
选项
module_mono_enabled=(yes|no)
构建(Android)
环境准备
- openJDK 17
- Android SDK(Android Studio)
设置ANDROID_HOME
和ANDROID_SDK_ROOT
为Android SDK路径
export templates
scons platform=android target=template_release arch=arm64
# 可以同时准备多个架构
# Template
cd platform/android/java
.\gradlew generateGodotTemplates
#Editor
.\gradlew generateGodotEditor
会在bin目录下出现android_release(debug).apk
.NET
添加以下选项即可:
module_mono_enable=yes
构建时配置AES密钥
set SCRIPT_AES256_ENCRYPTION_KEY=your_generated_key
密钥为十六进制256位AES密钥,字符串长度应为64字节
需要在编辑器中设置