一键导入
godot-organize-assets
当 Godot 项目的资源(精灵图、音频、字体、材质)组织混乱时使用。 检测分散的资源文件并将其整理为清晰的分类,使用一致的命名。 在有益时创建精灵图集,按类型整理音频,并将相关资源分组。
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
当 Godot 项目的资源(精灵图、音频、字体、材质)组织混乱时使用。 检测分散的资源文件并将其整理为清晰的分类,使用一致的命名。 在有益时创建精灵图集,按类型整理音频,并将相关资源分组。
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
当 Godot 代码中存在通过 get_node()、get_parent() 或直接引用产生的紧耦合依赖时使用。 检测耦合模式并将其转换为基于 Signal 的通信方式。组件变得独立、可测试且可复用。 在改进架构的同时精确保留原有行为。
当 Godot 代码中存在相互冲突的操作导致未定义行为时使用。检测同一属性在多处设置 (_ready、_process、代码+编辑器)、同一 Signal 多次连接、冲突的物理模式、 竞争的动画等问题。自动通过明确的所有权归属解决冲突。
用于创建带有自定义面板、停靠栏和工具的 Godot 编辑器插件。生成 plugin.cfg 配置、 EditorPlugin 脚本模板、自定义编辑器 UI 组件,并集成 ProjectSettings。按照 Godot 4.x 最佳实践创建完整的插件结构。
当 Godot 代码中存在硬编码的游戏数据(如 const 数组、字典或内嵌值)时使用。检测内联数据 如敌人属性、物品定义、关卡配置等。自动提取为 .tres Resource 文件,使数据在编辑器中 可见、易于修改,并支持数据驱动的设计。
当构建 Godot 功能时,代码使用 .new() 创建节点而非使用场景时触发。 检测 Timer.new()、Area2D.new()、Sprite2D.new() 等代码创建的对象。 自动生成 .tscn 场景文件,更新父脚本使用 @onready 引用,并创建可复用的组件库。
当 Godot 项目在编辑器(.tscn)和代码(.gd)之间存在位置冲突、相机跟随背景、 或运行时位置与编辑器预览不匹配时使用。编排所有 3 个位置同步子技能: sync-static-positions、sync-camera-positions 和 sync-parallax。 每个操作针对特定的位置冲突类型。
| name | godot-organize-assets |
| version | 3.0.0 |
| displayName | 整理资源文件 |
| description | 当 Godot 项目的资源(精灵图、音频、字体、材质)组织混乱时使用。 检测分散的资源文件并将其整理为清晰的分类,使用一致的命名。 在有益时创建精灵图集,按类型整理音频,并将相关资源分组。 |
| author | Asreonn |
| license | MIT |
| category | game-development |
| type | tool |
| difficulty | beginner |
| audience | ["developers"] |
| keywords | ["godot","asset-organization","sprites","audio","sprite-atlases","file-structure","performance","assets"] |
| platforms | ["macos","linux","windows"] |
| repository | https://github.com/asreonn/godot-superpowers |
| homepage | https://github.com/asreonn/godot-superpowers#readme |
| permissions | {"filesystem":{"read":[".png",".jpg",".wav",".ogg",".ttf",".glb",".tres"],"write":["*"],"move":true,"delete":false},"git":true} |
| behavior | {"auto_rollback":true,"validation":true,"git_commits":true} |
| outputs | 整理后的资源目录、移动的文件、精灵图集、命名一致性、git 提交 |
| requirements | Git 仓库、Godot 4.x |
| execution | 全自动,保留引用 |
| integration | godot-organize-project 编排器的一部分,与 godot-organize-files 协同工作 |
资源按类型和用途整理。 容易查找,容易维护,容易优化。
查找类似这样的资源目录:
assets/
├── player_sprite.png
├── enemy1.png
├── enemy2.png
├── jump.wav
├── background_music.ogg
├── font.ttf
├── tile1.png
├── tile2.png
└── ...(100 多个混杂的资源)
转换为:
assets/
├── sprites/
│ ├── characters/
│ │ └── player_sprite.png
│ ├── enemies/
│ │ ├── enemy1.png
│ │ └── enemy2.png
│ └── environment/
│ ├── tiles/
│ │ ├── tile1.png
│ │ └── tile2.png
│ └── atlases/
│ └── environment_atlas.png # 合并的瓦片
├── audio/
│ ├── music/
│ │ └── background_music.ogg
│ └── sfx/
│ └── jump.wav
└── fonts/
└── font.ttf
识别:
包含大量精灵图、音效或视觉资源的游戏。
创建精灵图集可减少绘制调用。
查找特定资源变得困难。
清晰的结构支持自动化处理。
主要整理:精灵图、音频、字体、材质。
次要整理:角色、敌人、环境、UI。
第三级整理:动画、图标、背景、特效。
sprites/
├── characters/
│ ├── player/
│ │ ├── idle/
│ │ │ ├── idle_01.png
│ │ │ ├── idle_02.png
│ │ │ └── idle_03.png
│ │ ├── run/
│ │ └── jump/
│ └── npc/
├── enemies/
│ ├── goblin/
│ ├── orc/
│ └── dragon/
├── items/
│ ├── weapons/
│ ├── consumables/
│ └── collectibles/
├── environment/
│ ├── tiles/
│ ├── props/
│ └── backgrounds/
└── ui/
├── icons/
├── buttons/
└── panels/
audio/
├── music/
│ ├── main_theme.ogg
│ ├── battle_music.ogg
│ └── ambient/
│ ├── forest.ogg
│ └── cave.ogg
├── sfx/
│ ├── player/
│ │ ├── jump.wav
│ │ ├── land.wav
│ │ └── attack.wav
│ ├── enemies/
│ │ ├── hit.wav
│ │ └── death.wav
│ ├── ui/
│ │ ├── click.wav
│ │ └── hover.wav
│ └── environment/
│ ├── door_open.wav
│ └── chest_open.wav
└── voice/ # 适用于有语音的游戏
检测图集机会:
在以下情况创建图集:
示例:
# 之前:20 个独立的 UI 图标文件(20 次绘制调用)
ui/icons/health_icon.png
ui/icons/mana_icon.png
...(18 个更多)
# 之后:1 个图集纹理(1 次绘制调用)
ui/atlases/ui_icons_atlas.png
ui/atlases/ui_icons_atlas.png.import # 定义图集区域
character_player_idle_01.pngenemy_goblin_attack_03.pngitem_sword_iron.pngmusic_main_theme.oggsfx_player_jump.wavambient_forest_birds.oggmat_character_player.tresmat_environment_grass.tres一致的命名可以:
检测使用模式:
基于以下因素优化:
协同工作:
不要在以下情况重新整理:
没有图集:
有图集:
性能提升显著,尤其在移动端。
| 之前 | 之后 |
|---|---|
根目录中的 player.png | assets/sprites/characters/player/idle.png |
混杂的 sound.wav | assets/audio/sfx/player/jump.wav |
| 20 个分散的图标 | assets/sprites/ui/atlases/ui_atlas.png |
assets 中的 font.ttf | assets/fonts/main_font.ttf |
默认值遵循 Godot 最佳实践和性能指南。