mirror of
https://github.com/All-Of-Us-Mods/MiraAPI.git
synced 2026-10-19 15:51:48 +00:00
3.6 KiB
3.6 KiB
English | [简体中文]
此模组与 Among Us 或 Innersloth LLC 无关,其中包含的内容未得到 Innersloth LLC 的认可或赞助。本文所含部分材料为 Innersloth LLC 的财产。© Innersloth LLC。
Mira API
一个全面、易上手的 Among Us 模组 API 及实用工具库,内含:
- 角色
- 选项
- 附加职业
- 按钮
- 自定义颜色
- 事件
- 投票
- 资源
- 快捷键
- 本地设置
- 自定义游戏结束条件
- 强兼容性
游戏模式(敬请期待)
Mira API 力求全面而易于上手,同时尽可能复用原版游戏元素。 它是一个更简洁、覆盖常见用例的模组 API,减少了对游戏源码的修改。
加入 Discord 获取支持并了解最新版本
使用方法
要开始使用 Mira API,你需要:
- 通过 DLL、项目引用或 NuGet 包 添加对 Mira API 的引用。
- 在你的插件类上添加 BepInDependency,如下所示:
[BepInDependency(MiraApiPlugin.Id)] - 在你的插件类上实现
IMiraPlugin接口。
Mira API 还依赖 Reactor 才能正常运行!
记得将其作为引用和 BepInDependency 包含进来!
完整示例请参见 此文件。
推荐的项目结构
使用 Mira API 时,强烈建议遵循以下项目结构,以保持代码整洁有序。 你也可以查看本仓库中的示例模组以获得一些指导。
MyMiraMod/
├── Buttons/
│ └── MyCoolButton.cs
├── Options/
│ ├── Roles/
│ │ └── CoolCustomRoleOptions.cs
│ └── MainOptionGroup.cs
├── Patches/
│ ├── Roles/
│ │ └── CoolCustomRole/
│ │ ├── PlayerControlPatches.cs
│ │ └── ExileControllerPatches.cs
│ └── General/
│ └── HudManagerPatches.cs
├── Resources/
│ ├── CoolButton.png
│ └── myAssets-win-x86.bundle
├── Roles/
│ └── CoolCustomRole.cs
├── MyMiraModPlugin.cs
└── MyModAssets.cs
文档
Mira API 每个功能的完整文档可在 wiki 上找到: