A Dance of Fire and Ice (ADOFAI) UnityModManager (UMM) Mod development template.
这是一个 A Dance of Fire and Ice (ADOFAI) 的 UnityModManager (UMM) Mod 开发模板项目。
Project Root / 项目根目录/
├── ADOFAIModTemplate.csproj # Project file / 项目文件
├── Main.cs # Main mod class / 主 Mod 类
├── Settings.cs # Mod settings class / Mod 设置类
├── Patches.cs # Harmony patches / Harmony 补丁
├── Info.json # UMM mod info file / UMM Mod 信息文件
├── Properties/
└── AssemblyInfo.cs # Assembly info / 程序集信息
- ✅ UnityModManager integration / UnityModManager 集成
- ✅ Harmony patch support / Harmony 补丁支持
- ✅ Mod settings with GUI / 带 GUI 的 Mod 设置
- ✅ Auto-deploy to game folder / 自动部署到游戏文件夹
- ✅ Optional auto-launch game / 可选的自动启动游戏
- ✅ Bilingual comments (English/Chinese) / 双语注释(英文/中文)
- .NET Framework 4.8.1
- Visual Studio 2019+ / JetBrains Rider
- UnityModManager 0.27.0+
- Harmony 2.3.3
# Install from local NuGet package
# 从本地 NuGet 包安装
dotnet new install path\to\StArray.ADOFAIModTemplate.1.0.0.nupkg
# Or install from local repository
# 或从本地存储库安装
dotnet new install path\to\ADOFAIModTemplateUsing Command Line / 使用命令行:
# Basic usage (use --name or -n to specify project name)
# 基础用法(使用 --name 或 -n 指定项目名称)
dotnet new adofaimod --name MyModName
# With all parameters
# 完整参数
dotnet new adofaimod -n MyModName -d "My Mod Description" -a "Your Name" -v "1.0.0"
# With game path (auto-deploy and launch)
# 带游戏路径(自动部署和启动)
dotnet new adofaimod -n MyModName -g "C:\Games\ADOFAI\A Dance of Fire and Ice.exe"
# Create solution file (if needed)
# 创建解决方案文件(如果需要)
cd MyModName
dotnet new sln --name MyModName
dotnet sln add MyModName.csprojUsing IDE / 使用 IDE:
After installing the template, you can also create projects directly from your IDE:
安装模板后,也可以直接从 IDE 中创建项目:
-
Visual Studio: Create a new project -> Search templates -> Search for "ADOFAI" or "Base ADOFAI Mod Template"
-
Visual Studio: 创建新项目 -> 搜索模板 -> 搜索 "ADOFAI" 或 "Base ADOFAI Mod Template"
-
JetBrains Rider: File (in editor) -> New Solution -> Custom Templates -> Base ADOFAI Mod Template
-
JetBrains Rider: 文件(在编辑器中)-> 新建解决方案 -> 自定义模板 -> Base ADOFAI Mod Template
-d, --description: Mod description / Mod 描述-a, --author: Author name / 作者名称-v, --version: Version number / 版本号-g, --game-path: Game exe path (optional, for auto-deploy and launch) / 游戏 exe 路径
dotnet new uninstall StArray.ADOFAIModTemplate- Open the
.csprojfile or.slnfile (if created) in Visual Studio or Rider / 在 Visual Studio 或 Rider 中打开.csproj或.sln文件(如果已创建) - The IDE will automatically create a solution if opening .csproj directly / 如果直接打开 .csproj,IDE 会自动创建解决方案
- Select Debug or Release configuration / 选择 Debug 或 Release 配置
- Press F6 (VS) or Ctrl+Shift+F9 (Rider) or click "Build" -> "Build Solution" / 按 F6 (VS) 或 Ctrl+Shift+F9 (Rider) 或点击"生成" -> "生成解决方案"
- Files will be automatically copied to
out/folder / 文件会自动复制到out/文件夹 - If game path is configured, mod will be deployed and game launched (if enabled) / 如果配置了游戏路径,会自动部署 Mod 并启动游戏(如果启用)
# Build with solution file / 使用解决方案文件构建
dotnet build YourModName.sln -c Release
# Or build project directly / 或直接构建项目
dotnet build YourModName.csproj -c ReleaseIf you didn't specify the game path when creating the project, you can manually edit the .csproj file:
如果创建项目时没有指定游戏路径,可以手动编辑 .csproj 文件:
<PropertyGroup>
<GameExePath>C:\Games\ADOFAI\A Dance of Fire and Ice.exe</GameExePath>
<AutoLaunchGame>true</AutoLaunchGame>
</PropertyGroup>Properties / 属性:
GameExePath: Path to game executable / 游戏可执行文件路径AutoLaunchGame: Set totrueto auto-launch game after build,falseto disable / 设为true构建后自动启动游戏,false禁用
After configuration, each build will automatically:
配置后,每次构建都会自动:
- Copy files to
out/folder / 复制文件到out/文件夹 - Deploy to game's
Mods/YourModName/folder / 部署到游戏的Mods/YourModName/文件夹 - Launch the game (if
AutoLaunchGameistrue) / 启动游戏(如果AutoLaunchGame为true)
After building, copy all files from the out/ folder to the game's Mods directory:
构建完成后,将 out/ 文件夹中的所有文件复制到游戏的 Mods 目录:
<Game Directory>/Mods/YourModName/
Or use the auto-deploy feature by configuring GameExePath in the .csproj file.
或者通过在 .csproj 文件中配置 GameExePath 使用自动部署功能。
- Implement your mod functionality in
Main.cs/ 在Main.cs中实现你的 Mod 功能 - Use Harmony to create patch classes to modify game behavior / 使用 Harmony 创建补丁类来修改游戏行为
- Update mod information in
Info.json/ 更新Info.json中的 Mod 信息 - Add settings in
Settings.cs/ 在Settings.cs中添加设置 - Add more class files as needed / 根据需要添加更多类文件
GPL-3.0-or-later
- Repository / 仓库: https://github.com/StArrayJaN/ADOFAIModTemplate
- ADOFAI: https://store.steampowered.com/app/977950/A_Dance_of_Fire_and_Ice/
- UnityModManager: https://www.nexusmods.com/site/mods/21