用途:在开发 Godot Engine 项目时提供专门指导,重点是让编码助手正确处理 Godot 特有的文件结构。适用于创建或修改 .tscn(场景)、.tres(资源)文件,实现交互、属性、法术、背包等游戏系统,调试“文件加载失败”类资源错误,搭建组件化架构与信号驱动系统,以及实现基于资源的数据(物品、法术、能力)。
主要能力:区分 GDScript(.gd)与序列化格式(.tscn/.tres)的语法差异;强调 .tres/.tscn 中禁止使用 preload()、var、const、func,应使用 ExtResource("id")、SubResource("id") 和类型化数组 ArrayType;提供组件化架构、信号通信、逻辑与数据分离等模式;附带校验脚本、代码模板与参考文档。
使用方式:编辑 .tres/.tscn 后运行校验,例如 python3 scripts/validate_tres.py resources/spells/fireball.tres 与 python3 scripts/validate_tscn.py scenes/player/player.tscn;从 assets/templates/ 复制模板起步,如 cp assets/templates/component_template.gd src/components/my_component.gd;需要细节时查阅 references/file-formats.md、references/architecture-patterns.md、references/common-pitfalls.md、references/godot4-physics-api.md。也可用 Godot CLI,如 godot --path . --headless、godot --path . --check-only --script path/to/script.gd、godot --path . --import --headless --quit。
适用场景与限制:适合 Godot 项目开发、资源文件编辑与调试、CI 中无头导入与脚本校验。复杂 .tscn 层级建议在编辑器中修改,文本编辑后应立即测试;实例化场景需覆盖子节点属性,CPUParticles3D 使用 color_ramp 时网格材质需启用 vertex_color_use_as_albedo。具体收费、价格与平台支持信息暂未提供。