diff --git a/.github/instructions/asset-standards.instructions.md b/.github/instructions/asset-standards.instructions.md new file mode 100644 index 0000000..e707c5e --- /dev/null +++ b/.github/instructions/asset-standards.instructions.md @@ -0,0 +1,126 @@ +--- +description: "Use when creating, moving, renaming, or placing any Unity game assets, ScriptableObjects, Prefabs, scenes, art, audio, or scripts under Assets/_Game/. Also use when writing Addressables group/label assignments or AddressKeys.cs constants. Enforces Docs/Standards/AssetFolderSpec.md and Docs/Standards/AddressablesLabelSpec.md." +applyTo: "Assets/_Game/**" +--- + +# Asset Standards Enforcement + +Full specifications: +- Naming, directories, Addressables: `Docs/Standards/AssetFolderSpec.md` +- Addressable labels & groups: `Docs/Standards/AddressablesLabelSpec.md` + +When in doubt, **READ THE SPEC FILE** before deciding a path or name. + +--- + +## Asset Naming Prefix Table + +| Prefix | System | Example | +|--------|--------|---------| +| `PLY_` | Player | `PLY_Player.prefab`, `PLY_Player01.mat` | +| `ENM_` | Enemy | `ENM_GruntWarrior.prefab`, `ENM_E001_Stats.asset` | +| `WPN_` | Weapon | `WPN_SkyBlade.prefab`, `WPN_SkyBlade_Data.asset` | +| `SKL_` | Skill | `SKL_DashSlash_Data.asset` | +| `SPL_` | Spell | `SPL_Fireball.asset` | +| `CHM_` | Charm | `CHM_IronSkin.asset` | +| `PROJ_` | Projectile | `PROJ_Arrow.prefab` | +| `VFX_` | VFX | `VFX_HitSpark.prefab` | +| `COL_` | Collectible | `COL_HPOrb.prefab` | +| `UI_` | UI Prefab | `UI_HUD.prefab` | +| `SYS_` | Persistent Manager | `SYS_GameManager.prefab` | +| `ENV_` | Environment Structure | `ENV_Tilemap_Ground.prefab` | +| `WLD_` | World Object | `WLD_Chest.prefab` | +| `EVT_` | Event Channel SO | `EVT_PlayerDied.asset` | +| `CMB_` | Combat SO | `CMB_DamageSource_Sword.asset` | +| `MAP_` | Map data | `MAP_RoomData_Forest_01.asset` | +| `AUD_BGM_` | BGM audio | `AUD_BGM_Forest.asset` | +| `AUD_SFX_` | SFX audio | `AUD_SFX_HitImpact.asset` | +| `ABL_` | Ability | `ABL_DoubleJump.asset` | +| `SET_` | Settings | `SET_GlobalSettings.asset` | + +--- + +## Key Directory Rules + +| Asset Type | Must Go In | +|-----------|-----------| +| Sprite / Texture | `_Game/Art/Characters/…`, `_Game/Art/Effects/…`, `_Game/Art/UI/…` | +| AnimationClip / Controller | Same `…/{ID}/Animations/` folder as sprites | +| Material `.mat` | Same `…/{ID}/Materials/` folder as sprites | +| Sprite Atlas | `…/{ID}/Atlases/` subfolder beside its sprites | +| ScriptableObject `.asset` | `_Game/Data/{module}/` (never inside `Prefabs/` or `Art/`) | +| Event Channel SO | `_Game/Data/Events/{module}/` | +| Prefab (player/enemy/vfx/etc.) | `_Game/Prefabs/{category}/` | +| Scene | `_Game/Scenes/` (test scenes → `Scenes/Testings/`) | +| Shader Graph | `_Game/Shaders/BaseASE/{category}/` | +| HLSL include | `_Game/Shaders/Includes/` | +| UXML / USS | `_Game/UI Toolkit/Layouts/` or `Styles/` | +| Skill SO | `_Game/Data/Progression/Skills/` | +| Weapon SO | `_Game/Data/Combat/Weapons/` | +| Charm SO | `_Game/Data/Progression/Charms/` | +| Config SO (dynamic) | `_Game/Data/Settings/` or `_Game/Data/{module}/` | + +--- + +## Addressables Group Assignment + +| Address Prefix | Group | +|---------------|-------| +| `Scene_` | `Scenes` | +| `PLY_`, `WPN_` | `Player` | +| `ENM_` | `Enemies` | +| `PROJ_` | `Projectiles` | +| `VFX_` | `VFX_Common` | +| `UI_` | `UI` | +| `COL_` | `Collectibles` | +| `CHM_`, `Config/` | `Config` | +| `AUD_` | `Audio_Music` | +| `Room_{Region}_*` | `Room_{Region}` (dynamic) | +| `Boss_{Name}` | `Boss_{Name}` (dynamic) | + +## Addressables Label Assignment + +| Address Prefix | Labels | +|---------------|--------| +| `PLY_` | `Preload` | +| `WPN_` | `Weapon`, `Preload` | +| `ENM_` | `Enemy` | +| `PROJ_` | `Poolable`, `Preload` | +| `VFX_` | `Poolable`, `Preload` | +| `COL_` | `Poolable`, `Preload` | +| `CHM_` | `Charms` | +| `Config/` | `Config` | +| `AUD_BGM_` | `BGM` | +| `AUD_SFX_` | `SFX` | +| `Scene_MainMenu` | `Preload` (exact override) | +| `UI_FloatingDamageText` | `Poolable`, `Preload` (exact override) | + +--- + +## Required: Use Editor Tools + +Never create assets manually in Project window. Always use the editor tools: + +| Asset to Create | Tool | Menu Path | +|----------------|------|-----------| +| Enemy SO | Enemy Data Manager | `BaseGames/Data/Enemy Data Manager` | +| Weapon SO | Weapon Editor | `BaseGames/Data/Weapon Editor` | +| Weapon HitBox Prefab | Weapon HitBox Wizard | `BaseGames/Create/Weapon HitBox Prefab` | +| Skill SO | Skill Editor | `BaseGames/Data/Skill Editor` | +| Skill HitBox Prefab | Skill HitBox Wizard | `BaseGames/Create/Skill HitBox Prefab` | +| Player Form SO | Character Wizard | `BaseGames/Data/Character Wizard` | +| Boss skill data | Boss Skill Sequence | `BaseGames/Data/Boss Skill Sequence` | +| Addressables group/label sync | Rule Sync | `BaseGames/Addressables/Rule Sync` | +| Addressables batch register | Addressable Batch Tool | `BaseGames/Addressables/Addressable Batch Tool` | +| Validate address keys | Validate Address Keys | `BaseGames/Addressables/Validate Address Keys` | + +--- + +## Hard Rules + +- All `Address` constants → `AddressKeys.cs`. Never hardcode strings in code. +- All asset loading → `AssetLoader.LoadAsync(AddressKeys.Xxx)`. Never call `Addressables.LoadAssetAsync` or `Resources.Load` directly. +- `EVT_*.asset` event channels are **never** registered as Addressables (use Inspector references). +- Sub-Prefabs (HitBox, HurtBox, bones) are **never** registered as Addressables. +- Test scenes in `Scenes/Testings/` are **never** registered as Addressables. +- All first-party assets must be under `Assets/_Game/`. Never place custom assets in third-party plugin folders.