dgame-dev
Skill178 starsChanged 33 days agoMITView on GitHub
DGame Unity 项目开发指导。触发词:DGame, GameModule, UIWindow, UIWidget, UIModule, AddUIEvent, GameEvent, GameEventDriver, EEventGroup, LoadAssetAsync, LoadGameObjectAsync, SetSprite, ConfigSystem, HybridCLR, YooAsset, Luban, RedDotModule, 热更, 资源加载, UI开发, 事件系统, 模块架构
In this repository7 other files it gives its agents.
- AGENTS.mdAGENTS.md
- GameUnity/AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- GameUnity/CLAUDE.mdCLAUDE.md
- luban-devSkill
- skill-creatorSkill
- unity-cliSkill
The file
Files
DGame 开发指导
DGame 使用 HybridCLR + YooAsset + UniTask + Luban 构建。 本 skill 提供 DGame 专属的 AI 精炼说明,优先描述本仓库实际 API、目录和落位规则。
核心红线
- 分层落位:框架运行时放
GameUnity/Assets/DGame/Runtime,编辑器工具放GameUnity/Assets/DGame/Editor,热更玩法放GameUnity/Assets/Scripts/HotFix/GameLogic。热更边界:DGame.Runtime/DGame.AOT不热更,Scripts/HotFix/*全部热更。 - 模块访问:业务代码优先通过
GameLogic.GameModule.XXX访问模块,不在业务层散落ModuleSystem.GetModule<T>()。 - 异步优先:IO、资源、场景等耗时操作优先使用
UniTask,不要新增 Coroutine 工作流。 - 资源生命周期成对:非实例化资源用
LoadAssetAsync/LoadAsset后按持有关系UnloadAsset;GameObject 实例用LoadGameObjectAsync/LoadGameObject,销毁实例时资源模块自动回收引用。 - 事件解耦:UI 内部监听用
UIBase.AddUIEvent自动清理;跨模块事件用[EventInterface(EEventGroup...)]、GameEvent.Get<T>()或GameEvent.AddEventListener。 - 配置表边界:配置表结构、Excel、导表脚本优先使用
luban-dev;本 skill 只补充 DGame 业务代码如何消费配置。
防止误用的例外与优先级
- 模块访问分层:
GameLogic业务代码优先通过GameModule.XXX;DGame.Runtime框架内部、编辑器代码、GameModule的初始化桥接代码允许直接使用ModuleSystem.GetModule<T>(),不要为了机械遵守规则改动这些底层代码。 - 事件监听:UIWindow/UIWidget 在
RegisterEvent中使用AddUIEvent;非 UI 模块对带[EventInterface]的接口优先使用生成的GameEventHelper.AddEvent.Xxx.Xxx/GameEventHelper.RemoveEvent.Xxx.Xxx。只有没有生成门面或框架底层场景才直接调用GameEvent.AddEventListener/RemoveEventListener。IUIController不是UIBase,也必须按非 UI 生命周期处理,成对注册和移除。 - 资源例外:业务热更资源优先走
GameModule.ResourceModule;UIWindow.FromResources、AOT 的 Obfuz 密钥、框架音频混音器等已存在的Resources.Load路径属于框架例外,修改前先核对调用层,不要全局替换。 - 生成产物:Luban 的
GameProto/LubanConfig、事件/模块/输入等 Source Generator 产物不要手改;先修改 schema、接口或生成器源码,再重新生成并检查 Unity 编译。
文档路由
根据任务类型,读取对应的 reference 文档:
| 任务类型 | 必读文档 | 进阶文档 | 优先级 |
| UI 开发 | ui-lifecycle.md | ui-patterns.md | P0 |
| 事件系统 | event-system.md | event-antipatterns.md | P0 |
| 资源加载 | resource-api.md | resource-patterns.md | P0 |
| 热更资源包 | hotpatch-workflow.md | resource-api.md | P0 |
| 构建打包 | build-pipeline.md | hotfix-workflow.md | P1 |
| 模块使用 | modules.md | — | P0 |
| 热更代码 | hotfix-workflow.md | — | P1 |
| 代码规范 | naming-rules.md | — | P1 |
| Luban 配置 | luban-config.md | luban-dev | P1 |
| Unity CLI / MCP | unity-cli | - | P1 |
| 红点系统 | reddot-system.md | ui-patterns.md | P1 |
| 项目结构 | architecture.md | — | P2 |
| 问题排查 | troubleshooting.md | — | P2 |
使用原则
- 先读与任务直接相关的 reference,不要一次性加载全部文档。
- 如果 reference 与源码冲突,使用
rg搜索实际签名,优先信任源码,并在回复中标注冲突点。 - 修改配置表、
__tables__.xlsx、__beans__.xlsx、__enums__.xlsx、导表脚本或GameConfig/数据时,先使用luban-dev。 - 生成 UI 代码时匹配本仓库实际生命周期:
ScriptGenerator、BindMemberProperty、RegisterEvent、OnCreate、OnRefresh、OnDestroy。 - 资源地址通常等于
GameUnity/Assets/BundleAssets下资源文件名,不含路径和扩展名;改动前用实际资源和 YooAsset 设置验证。
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

