@aqian0/dsh-unity 0.0.0-stage → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (360) hide show
  1. package/CHANGELOG.md +53 -0
  2. package/LICENSE-UNITY-COMPANION.md +122 -0
  3. package/LICENSE.md +31 -0
  4. package/NOTICE.md +90 -0
  5. package/README.md +273 -2
  6. package/cordis.patch.yml +22 -0
  7. package/docs/design.md +297 -0
  8. package/icon.svg +16 -0
  9. package/lib/frontmatter.js +392 -0
  10. package/lib/gating.js +105 -0
  11. package/lib/harness.js +16 -0
  12. package/lib/index.js +171 -0
  13. package/lib/project.js +210 -0
  14. package/lib/registry.js +268 -0
  15. package/lib/requirements.js +214 -0
  16. package/lib/skills.js +191 -0
  17. package/lib/types/frontmatter.d.ts +84 -0
  18. package/lib/types/gating.d.ts +80 -0
  19. package/lib/types/harness.d.ts +152 -0
  20. package/lib/types/index.d.ts +75 -0
  21. package/lib/types/project.d.ts +93 -0
  22. package/lib/types/registry.d.ts +96 -0
  23. package/lib/types/requirements.d.ts +67 -0
  24. package/lib/types/skills.d.ts +54 -0
  25. package/lib/types/watch.d.ts +34 -0
  26. package/lib/watch.js +84 -0
  27. package/locale/en.json +6 -0
  28. package/locale/zh.json +6 -0
  29. package/package.json +70 -4
  30. package/skills/2d-pixel-perfect/SKILL.md +208 -0
  31. package/skills/2d-pixel-perfect/references/api-reference.md +81 -0
  32. package/skills/2d-pixel-perfect/references/camera-setup-builtin.cs +40 -0
  33. package/skills/2d-pixel-perfect/references/camera-setup-urp.cs +49 -0
  34. package/skills/2d-pixel-perfect/references/pipeline-detection.cs +50 -0
  35. package/skills/2d-pixel-perfect/references/sprite-settings.cs +37 -0
  36. package/skills/asset-transformer-toolkit/SECURITY.md +15 -0
  37. package/skills/asset-transformer-toolkit/SKILL.md +39 -0
  38. package/skills/asset-transformer-toolkit/references/create-importer.md +121 -0
  39. package/skills/asset-transformer-toolkit/references/lods.md +61 -0
  40. package/skills/asset-transformer-toolkit/references/rule-api.md +154 -0
  41. package/skills/asset-transformer-toolkit/references/ruleblock-api.md +37 -0
  42. package/skills/asset-transformer-toolkit/references/ruleset-api.md +138 -0
  43. package/skills/asset-transformer-toolkit/references/rulesets-and-actions.md +227 -0
  44. package/skills/audio-setup-mixers/SECURITY.md +16 -0
  45. package/skills/audio-setup-mixers/SKILL.md +127 -0
  46. package/skills/audio-setup-mixers/references/api.md +162 -0
  47. package/skills/build-gtk/SECURITY.md +16 -0
  48. package/skills/build-gtk/SKILL.md +200 -0
  49. package/skills/build-gtk/references/api-reference.md +33 -0
  50. package/skills/build-gtk/references/graph-api-gaps.md +96 -0
  51. package/skills/build-gtk/references/runtime-and-visualization.md +191 -0
  52. package/skills/build-gtk/references/state-machine-api.md +270 -0
  53. package/skills/build-gtk/references/where-the-docs-stop.md +49 -0
  54. package/skills/build-live-game/SKILL.md +159 -0
  55. package/skills/build-live-game/references/achievements.md +757 -0
  56. package/skills/build-live-game/references/apis.md +271 -0
  57. package/skills/build-live-game/references/authentication.md +431 -0
  58. package/skills/build-live-game/references/battlepass.md +904 -0
  59. package/skills/build-live-game/references/blueprints-and-samples.md +75 -0
  60. package/skills/build-live-game/references/cloud-code-cloudbehaviours.md +1111 -0
  61. package/skills/build-live-game/references/cloud-code-modules.md +1276 -0
  62. package/skills/build-live-game/references/cloud-code.md +58 -0
  63. package/skills/build-live-game/references/cloud-save.md +464 -0
  64. package/skills/build-live-game/references/deployment.md +231 -0
  65. package/skills/build-live-game/references/orientation.md +30 -0
  66. package/skills/build-live-game/references/player-account.md +821 -0
  67. package/skills/build-live-game/references/remote-config.md +96 -0
  68. package/skills/build-live-game/references/services-overview.md +76 -0
  69. package/skills/build-live-game/references/tooling.md +375 -0
  70. package/skills/build-live-game/references/ugs-cli.md +86 -0
  71. package/skills/craft-game-floors/SECURITY.md +23 -0
  72. package/skills/craft-game-floors/SKILL.md +134 -0
  73. package/skills/craft-game-floors/references/art-direction.md +85 -0
  74. package/skills/craft-game-floors/references/camera-rigs.md +51 -0
  75. package/skills/craft-game-floors/references/character-motion.md +35 -0
  76. package/skills/craft-game-floors/references/game-audio.md +47 -0
  77. package/skills/craft-game-floors/references/game-feel.md +68 -0
  78. package/skills/craft-game-floors/references/game-shell.md +45 -0
  79. package/skills/craft-game-floors/references/live-floor.md +35 -0
  80. package/skills/craft-game-floors/references/placeholder-assets.md +35 -0
  81. package/skills/craft-game-floors/references/scene-lighting.md +52 -0
  82. package/skills/craft-game-floors/references/toon-shading.md +34 -0
  83. package/skills/craft-game-floors/references/vfx.md +40 -0
  84. package/skills/craft-game-floors/references/visual-scorecard.md +43 -0
  85. package/skills/create-2d-physics/SECURITY.md +16 -0
  86. package/skills/create-2d-physics/SKILL.md +128 -0
  87. package/skills/create-2d-physics/references/2d-physics-core.md +155 -0
  88. package/skills/create-2d-physics/references/legacy-2d-physics.md +45 -0
  89. package/skills/create-tile-palette-or-rule-tiles/SKILL.md +95 -0
  90. package/skills/create-tile-palette-or-rule-tiles/references/hexagonalruletile.md +71 -0
  91. package/skills/create-tile-palette-or-rule-tiles/references/palette-create.md +38 -0
  92. package/skills/create-tile-palette-or-rule-tiles/references/ruletile-createempty.md +37 -0
  93. package/skills/create-tile-palette-or-rule-tiles/references/ruletile-createfromsegment.md +219 -0
  94. package/skills/create-tile-palette-or-rule-tiles/references/ruletile.md +95 -0
  95. package/skills/create-tile-palette-or-rule-tiles/scripts/CreatePaletteTemplate.cs +148 -0
  96. package/skills/create-tile-palette-or-rule-tiles/scripts/ManualWorkflowExample.cs +63 -0
  97. package/skills/create-tile-palette-or-rule-tiles/scripts/RuleTileGenerator.cs +61 -0
  98. package/skills/create-tile-palette-or-rule-tiles/scripts/TilemapRuleTileCreateFromSegment.cs +225 -0
  99. package/skills/fix-3d-physics-collisions/SECURITY.md +17 -0
  100. package/skills/fix-3d-physics-collisions/SKILL.md +139 -0
  101. package/skills/fix-3d-physics-collisions/references/collision-checklist.md +80 -0
  102. package/skills/fix-3d-physics-collisions/references/collision-debugger.md +18 -0
  103. package/skills/fix-3d-physics-collisions/references/console-errors-table.md +9 -0
  104. package/skills/fix-3d-physics-collisions/references/kinematic-trigger-facts.md +18 -0
  105. package/skills/fix-3d-physics-collisions/references/other-symptoms.md +29 -0
  106. package/skills/fix-3d-physics-collisions/references/raycast-checklist.md +8 -0
  107. package/skills/fix-3d-physics-collisions/references/topic-map.md +42 -0
  108. package/skills/fix-3d-physics-collisions/references/trigger-checklist.md +9 -0
  109. package/skills/fix-3d-physics-collisions/scripts/CollisionDebugger.cs +561 -0
  110. package/skills/generate-editor-search-query/SECURITY.md +17 -0
  111. package/skills/generate-editor-search-query/SKILL.md +117 -0
  112. package/skills/generate-editor-search-query/references/open-search-window.md +70 -0
  113. package/skills/generate-editor-search-query/references/query-patterns.md +124 -0
  114. package/skills/implement-in-app-purchases/SKILL.md +82 -0
  115. package/skills/implement-in-app-purchases/references/api-details.md +41 -0
  116. package/skills/implement-in-app-purchases/references/api-notes.md +105 -0
  117. package/skills/implement-in-app-purchases/references/codeless-catalog.md +197 -0
  118. package/skills/implement-in-app-purchases/references/convert-adapty.md +270 -0
  119. package/skills/implement-in-app-purchases/references/convert-essentialkit.md +239 -0
  120. package/skills/implement-in-app-purchases/references/convert-revenuecat.md +277 -0
  121. package/skills/implement-in-app-purchases/references/convert-unipay.md +145 -0
  122. package/skills/implement-in-app-purchases/references/migration-v4-to-v5.md +46 -0
  123. package/skills/implement-in-app-purchases/references/path-add-iap-to-new-project.md +197 -0
  124. package/skills/implement-in-app-purchases/references/path-convert-native-google-billing.md +302 -0
  125. package/skills/implement-in-app-purchases/references/path-convert-native-storekit.md +357 -0
  126. package/skills/implement-in-app-purchases/references/path-implement-iap-d2c.md +253 -0
  127. package/skills/implement-in-app-purchases/references/platform-notes.md +55 -0
  128. package/skills/implement-in-app-purchases/references/pre-check.md +207 -0
  129. package/skills/implement-in-app-purchases/references/topic-map.md +46 -0
  130. package/skills/initialize-ai-navigation/SKILL.md +109 -0
  131. package/skills/initialize-ai-navigation/references/navigation-system.md +793 -0
  132. package/skills/initialize-ai-navigation/references/topic-map.md +66 -0
  133. package/skills/levelplay-unity-integration/SKILL.md +122 -0
  134. package/skills/levelplay-unity-integration/references/adding-more-ad-formats.md +15 -0
  135. package/skills/levelplay-unity-integration/references/banner-api.md +927 -0
  136. package/skills/levelplay-unity-integration/references/best-practices.md +604 -0
  137. package/skills/levelplay-unity-integration/references/dependency-resolution.md +94 -0
  138. package/skills/levelplay-unity-integration/references/examples.md +10 -0
  139. package/skills/levelplay-unity-integration/references/ilrd-api.md +337 -0
  140. package/skills/levelplay-unity-integration/references/initialization-api.md +851 -0
  141. package/skills/levelplay-unity-integration/references/interstitial-api.md +907 -0
  142. package/skills/levelplay-unity-integration/references/ios-setup.md +463 -0
  143. package/skills/levelplay-unity-integration/references/migration-sdk-9.md +666 -0
  144. package/skills/levelplay-unity-integration/references/privacy-settings.md +593 -0
  145. package/skills/levelplay-unity-integration/references/production-release-checklist.md +22 -0
  146. package/skills/levelplay-unity-integration/references/rewarded-api.md +918 -0
  147. package/skills/levelplay-unity-integration/references/step-0-new-or-migration.md +8 -0
  148. package/skills/levelplay-unity-integration/references/step-1-verify-environment.md +4 -0
  149. package/skills/levelplay-unity-integration/references/step-10-testing.md +15 -0
  150. package/skills/levelplay-unity-integration/references/step-2-business-goals.md +12 -0
  151. package/skills/levelplay-unity-integration/references/step-3-install-sdk.md +55 -0
  152. package/skills/levelplay-unity-integration/references/step-4-native-dependencies.md +22 -0
  153. package/skills/levelplay-unity-integration/references/step-5-app-key-and-ad-units.md +18 -0
  154. package/skills/levelplay-unity-integration/references/step-6-5-privacy-and-regulation.md +51 -0
  155. package/skills/levelplay-unity-integration/references/step-6-admob-keys.md +16 -0
  156. package/skills/levelplay-unity-integration/references/step-7-initialize.md +50 -0
  157. package/skills/levelplay-unity-integration/references/step-8-ad-unit-strategy.md +16 -0
  158. package/skills/levelplay-unity-integration/references/step-9-implement-ad-units.md +66 -0
  159. package/skills/levelplay-unity-integration/references/testing-and-validation.md +222 -0
  160. package/skills/levelplay-unity-integration/references/troubleshooting.md +99 -0
  161. package/skills/localize-unity-project/SKILL.md +159 -0
  162. package/skills/localize-unity-project/references/api-notes.md +15 -0
  163. package/skills/localize-unity-project/references/cjk-fonts.md +83 -0
  164. package/skills/localize-unity-project/references/docs-map.md +42 -0
  165. package/skills/localize-unity-project/references/documentation-lookup.md +33 -0
  166. package/skills/localize-unity-project/references/locale-switching.md +17 -0
  167. package/skills/localize-unity-project/references/table-completeness-check.md +47 -0
  168. package/skills/localize-unity-project/references/translating-existing-project.md +47 -0
  169. package/skills/localize-unity-project/references/translation-strategy.md +41 -0
  170. package/skills/localize-unity-project/references/troubleshooting.md +12 -0
  171. package/skills/localize-unity-project/scripts/L10nBatchProcessor.cs +191 -0
  172. package/skills/localize-unity-project/scripts/LocalizedFontAsset.cs +18 -0
  173. package/skills/manage-sprite-atlas/SKILL.md +202 -0
  174. package/skills/manage-sprite-atlas/references/addressables-delivery.md +58 -0
  175. package/skills/manage-sprite-atlas/references/advanced-manual-authoring.md +19 -0
  176. package/skills/manage-sprite-atlas/references/api.md +382 -0
  177. package/skills/manage-sprite-atlas/references/best-practices.md +183 -0
  178. package/skills/manage-sprite-atlas/references/common-errors.md +123 -0
  179. package/skills/manage-sprite-atlas/references/complete-workflow.md +61 -0
  180. package/skills/manage-sprite-atlas/references/custom-packing.md +147 -0
  181. package/skills/manage-sprite-atlas/references/delivery-mechanism.md +30 -0
  182. package/skills/manage-sprite-atlas/references/key-requirements.md +21 -0
  183. package/skills/manage-sprite-atlas/references/manual-authoring.md +39 -0
  184. package/skills/manage-sprite-atlas/references/namespaces.md +15 -0
  185. package/skills/manage-sprite-atlas/references/v2-architecture.md +21 -0
  186. package/skills/manage-sprite-atlas/resources/authoringvsruntime.cs +176 -0
  187. package/skills/manage-sprite-atlas/resources/buildaddressablespostprocess.cs +59 -0
  188. package/skills/manage-sprite-atlas/resources/cacheloadedatlases.cs +145 -0
  189. package/skills/manage-sprite-atlas/resources/cleanupbatchoperations.cs +119 -0
  190. package/skills/manage-sprite-atlas/resources/createandconfiguremasteratlas.cs +57 -0
  191. package/skills/manage-sprite-atlas/resources/custompackersetup.cs +88 -0
  192. package/skills/manage-sprite-atlas/resources/deprecatedmethods.cs +142 -0
  193. package/skills/manage-sprite-atlas/resources/dontmodifywithoutsaving.cs +120 -0
  194. package/skills/manage-sprite-atlas/resources/dontpackinruntimebuilds.cs +190 -0
  195. package/skills/manage-sprite-atlas/resources/dontscriptspriteatlasineditor.cs +114 -0
  196. package/skills/manage-sprite-atlas/resources/editorconfiguration.cs +95 -0
  197. package/skills/manage-sprite-atlas/resources/enablespritepacking.cs +172 -0
  198. package/skills/manage-sprite-atlas/resources/gridspritepacker.cs +50 -0
  199. package/skills/manage-sprite-atlas/resources/handlelatebinding.cs +147 -0
  200. package/skills/manage-sprite-atlas/resources/handlenullcases.cs +141 -0
  201. package/skills/manage-sprite-atlas/resources/migratev1tov2.cs +335 -0
  202. package/skills/manage-sprite-atlas/resources/multipagepacker.cs +80 -0
  203. package/skills/manage-sprite-atlas/resources/optimizetexturesettings.cs +191 -0
  204. package/skills/manage-sprite-atlas/resources/packerdebugging.cs +158 -0
  205. package/skills/manage-sprite-atlas/resources/packtransform.cs +51 -0
  206. package/skills/manage-sprite-atlas/resources/platformnames.cs +127 -0
  207. package/skills/manage-sprite-atlas/resources/queryspritesefficiently.cs +222 -0
  208. package/skills/manage-sprite-atlas/resources/registercallbacks.cs +152 -0
  209. package/skills/manage-sprite-atlas/resources/runtimeatlasloader.cs +15 -0
  210. package/skills/manage-sprite-atlas/resources/runtimespriteaccess.cs +19 -0
  211. package/skills/manage-sprite-atlas/resources/savespriteatlasasset.cs +107 -0
  212. package/skills/manage-sprite-atlas/resources/scriptablepacker.cs +81 -0
  213. package/skills/manage-sprite-atlas/resources/setincludeinbuild.cs +164 -0
  214. package/skills/manage-sprite-atlas/resources/sizeoptimizedpacker.cs +88 -0
  215. package/skills/manage-sprite-atlas/resources/spriteatlaslatebinding.cs +123 -0
  216. package/skills/manage-sprite-atlas/resources/spriteatlasprebuildgenerator.cs +219 -0
  217. package/skills/manage-sprite-atlas/resources/spritedata.cs +35 -0
  218. package/skills/manage-sprite-atlas/resources/spritepack.cs +39 -0
  219. package/skills/manage-sprite-atlas/resources/texturedata.cs +15 -0
  220. package/skills/manage-sprite-atlas/resources/updatebuildscripts.cs +357 -0
  221. package/skills/manage-sprite-atlas/resources/updatesettingsconfiguration.cs +135 -0
  222. package/skills/manage-sprite-atlas/resources/usevariantswisely.cs +179 -0
  223. package/skills/manage-sprite-atlas/resources/variantatlas.cs +39 -0
  224. package/skills/migrate-birp-to-urp/SECURITY.md +16 -0
  225. package/skills/migrate-birp-to-urp/SKILL.md +167 -0
  226. package/skills/migrate-birp-to-urp/references/capturing-the-editor.md +66 -0
  227. package/skills/migrate-birp-to-urp/references/complex-shader-situations.md +272 -0
  228. package/skills/migrate-birp-to-urp/references/conversion-and-rendering-triage.md +113 -0
  229. package/skills/migrate-birp-to-urp/references/custom-shader-triage.md +123 -0
  230. package/skills/migrate-birp-to-urp/references/implementation-patterns.md +529 -0
  231. package/skills/migrate-birp-to-urp/references/migration-workflow.md +265 -0
  232. package/skills/migrate-birp-to-urp/references/parity-validation-and-troubleshooting.md +114 -0
  233. package/skills/migrate-birp-to-urp/references/preflight-and-urp-setup.md +195 -0
  234. package/skills/migrate-birp-to-urp/references/quality-settings-map.md +69 -0
  235. package/skills/new-unity-project/SECURITY.md +26 -0
  236. package/skills/new-unity-project/SKILL.md +171 -0
  237. package/skills/new-unity-project/references/checklist.md +18 -0
  238. package/skills/new-unity-project/references/common-mistakes.md +15 -0
  239. package/skills/new-unity-project/references/skill-setup.md +66 -0
  240. package/skills/new-unity-project/references/step-1-concept.md +13 -0
  241. package/skills/new-unity-project/references/step-2-platforms-and-create.md +31 -0
  242. package/skills/new-unity-project/references/step-3-join-and-reconcile.md +16 -0
  243. package/skills/new-unity-project/references/step-4-source-control.md +9 -0
  244. package/skills/new-unity-project/references/step-5-packages.md +18 -0
  245. package/skills/new-unity-project/references/step-6-identity-and-floors.md +20 -0
  246. package/skills/new-unity-project/references/step-7-visual-baseline.md +75 -0
  247. package/skills/new-unity-project/references/step-8-first-commit.md +21 -0
  248. package/skills/new-unity-project/references/step-9-handoff.md +23 -0
  249. package/skills/optimize-audio/SECURITY.md +16 -0
  250. package/skills/optimize-audio/SKILL.md +120 -0
  251. package/skills/optimize-audio/references/diagnostics.md +42 -0
  252. package/skills/optimize-audio/references/troubleshooting.md +41 -0
  253. package/skills/optimize-audio/resources/audio-import-api.md +149 -0
  254. package/skills/optimize-audio/resources/platform-settings.md +48 -0
  255. package/skills/optimize-text-mesh-pro/SKILL.md +181 -0
  256. package/skills/optimize-text-mesh-pro/references/dynamic-atlas-and-profiling.md +28 -0
  257. package/skills/optimize-text-mesh-pro/references/topic-map.md +36 -0
  258. package/skills/optimize-web/SECURITY.md +16 -0
  259. package/skills/optimize-web/SKILL.md +157 -0
  260. package/skills/optimize-web/references/editor-csharp.md +120 -0
  261. package/skills/optimize-web/references/topic-map.md +49 -0
  262. package/skills/optimize-web/references/troubleshooting.md +45 -0
  263. package/skills/optimize-web/references/understand-request.md +19 -0
  264. package/skills/optimize-web/references/web-assets-quality.md +59 -0
  265. package/skills/optimize-web/references/web-player-settings.md +39 -0
  266. package/skills/optimize-web/references/web-profiling-memory.md +71 -0
  267. package/skills/optimize-web/scripts/WebOptimizer.cs +46 -0
  268. package/skills/optimize-web/scripts/toktx-examples.sh +11 -0
  269. package/skills/setup-multiplayer-services/SKILL.md +36 -0
  270. package/skills/setup-multiplayer-services/references/dgs-entrypoint.md +79 -0
  271. package/skills/setup-multiplayer-services/references/entrypoints.md +213 -0
  272. package/skills/setup-multiplayer-services/references/examples.md +33 -0
  273. package/skills/setup-multiplayer-services/references/implementation-fit.md +30 -0
  274. package/skills/setup-multiplayer-services/references/underlying-services.md +11 -0
  275. package/skills/setup-multiplayer-services/references/workflows-prerequisites.md +17 -0
  276. package/skills/setup-vivox-voice-chat/SECURITY.md +16 -0
  277. package/skills/setup-vivox-voice-chat/SKILL.md +166 -0
  278. package/skills/setup-vivox-voice-chat/references/api-reference-lookup.md +28 -0
  279. package/skills/setup-vivox-voice-chat/references/docs-topic-map.md +13 -0
  280. package/skills/setup-vivox-voice-chat/references/events-and-participants.md +79 -0
  281. package/skills/setup-vivox-voice-chat/references/init-and-login.md +92 -0
  282. package/skills/setup-vivox-voice-chat/references/text-chat.md +93 -0
  283. package/skills/setup-vivox-voice-chat/references/troubleshooting.md +47 -0
  284. package/skills/setup-vivox-voice-chat/references/voice-channels.md +92 -0
  285. package/skills/shader-graph-create-custom-node/SKILL.md +25 -0
  286. package/skills/shader-graph-create-custom-node/resources/all_hints.hlsl +182 -0
  287. package/skills/sprite-editor/SECURITY.md +16 -0
  288. package/skills/sprite-editor/SKILL.md +66 -0
  289. package/skills/sprite-editor/references/api_reference.md +151 -0
  290. package/skills/sprite-editor/references/background.md +112 -0
  291. package/skills/sprite-editor/references/templates.md +72 -0
  292. package/skills/sprite-editor/scripts/AutomaticSliceTexture.cs +40 -0
  293. package/skills/sprite-editor/scripts/GenerateNewSpriteRects.cs +200 -0
  294. package/skills/sprite-editor/scripts/GetTextureSourceImageSize.cs +32 -0
  295. package/skills/sprite-editor/scripts/GetTextureToSlice.cs +55 -0
  296. package/skills/sprite-editor/scripts/GridSliceTexture.cs +40 -0
  297. package/skills/sprite-editor/scripts/IsometricSliceTexture.cs +141 -0
  298. package/skills/sprite-editor/scripts/README.md +134 -0
  299. package/skills/sprite-editor/scripts/SetPivotExample.cs +58 -0
  300. package/skills/sprite-editor/scripts/SpriteToPng.cs +88 -0
  301. package/skills/sprite-segment-3x3grid/SKILL.md +177 -0
  302. package/skills/sprite-segment-3x3grid/references/topic-map.md +37 -0
  303. package/skills/sprite-segment-3x3grid/scripts/SpriteGridAnalysis.cs +119 -0
  304. package/skills/ui/SKILL.md +142 -0
  305. package/skills/ui-imgui/SKILL.md +180 -0
  306. package/skills/ui-imgui/references/gui-elements.md +156 -0
  307. package/skills/ui-imgui/references/templates.md +141 -0
  308. package/skills/ui-ugui/SKILL.md +217 -0
  309. package/skills/ui-ugui/references/layout-and-anchors.md +61 -0
  310. package/skills/ui-ugui/references/scrollview-setup.md +29 -0
  311. package/skills/ui-uitk/SKILL.md +229 -0
  312. package/skills/ui-uitk/references/common-issues.md +74 -0
  313. package/skills/ui-uitk/references/custom-elements.md +241 -0
  314. package/skills/ui-uitk/references/painter2d.md +282 -0
  315. package/skills/ui-uitk/references/pointermanipulator-guide.md +94 -0
  316. package/skills/ui-uitk/references/svg-icons.md +136 -0
  317. package/skills/ui-uitk/references/ui-runtime-binding.md +234 -0
  318. package/skills/ui-uitk/references/uss-guide.md +138 -0
  319. package/skills/unity-cli/CHANGELOG.md +524 -0
  320. package/skills/unity-cli/SECURITY.md +68 -0
  321. package/skills/unity-cli/SKILL.md +160 -0
  322. package/skills/unity-cli/references/auth-license-cloud.md +318 -0
  323. package/skills/unity-cli/references/bootstrap-project.md +177 -0
  324. package/skills/unity-cli/references/build-run-test.md +555 -0
  325. package/skills/unity-cli/references/catalog-plugins.md +86 -0
  326. package/skills/unity-cli/references/ci-recipes.md +76 -0
  327. package/skills/unity-cli/references/cloud-automation.md +819 -0
  328. package/skills/unity-cli/references/cloud-workflows.md +19 -0
  329. package/skills/unity-cli/references/collaboration.md +533 -0
  330. package/skills/unity-cli/references/config-hub.md +239 -0
  331. package/skills/unity-cli/references/diagnostics-maintenance.md +718 -0
  332. package/skills/unity-cli/references/docs-workflow.md +179 -0
  333. package/skills/unity-cli/references/editor-targeting.md +29 -0
  334. package/skills/unity-cli/references/editors-install.md +490 -0
  335. package/skills/unity-cli/references/environment-variables.md +42 -0
  336. package/skills/unity-cli/references/exit-codes.md +47 -0
  337. package/skills/unity-cli/references/global-flags.md +32 -0
  338. package/skills/unity-cli/references/integration-advanced.md +1130 -0
  339. package/skills/unity-cli/references/notes.md +20 -0
  340. package/skills/unity-cli/references/notifications.md +39 -0
  341. package/skills/unity-cli/references/playmode-verification-loop.md +279 -0
  342. package/skills/unity-cli/references/projects-templates.md +997 -0
  343. package/skills/unity-cli/references/scene-editing-preflight.md +25 -0
  344. package/skills/unity-cli/references/setup-and-help.md +54 -0
  345. package/skills/unity-cli/references/version-control.md +612 -0
  346. package/skills/unity-package-management/SKILL.md +169 -0
  347. package/skills/unity-package-management/references/discovering-packages.md +66 -0
  348. package/skills/unity-package-management/references/headless-run.md +31 -0
  349. package/skills/unity-package-management/references/installer-script.md +92 -0
  350. package/skills/unity-package-management/references/select-packages.md +126 -0
  351. package/skills/unity-pipeline/SECURITY.md +17 -0
  352. package/skills/unity-pipeline/SKILL.md +205 -0
  353. package/skills/unity-pipeline/references/csharp-eval.md +23 -0
  354. package/skills/unity-pipeline/references/multiplayer-play-mode.md +103 -0
  355. package/skills/urp-postprocessing/SECURITY.md +16 -0
  356. package/skills/urp-postprocessing/SKILL.md +188 -0
  357. package/skills/urp-postprocessing/references/code-templates.md +150 -0
  358. package/skills/urp-postprocessing/references/effect-reference.md +86 -0
  359. package/skills/validate-urp-render-graph-renderer-feature/SKILL.md +92 -0
  360. package/skills/validate-urp-render-graph-renderer-feature/references/validation-checklist.md +179 -0
@@ -0,0 +1,16 @@
1
+ # Security notes: optimize-audio
2
+
3
+ This skill has the agent run C# inside the user's open Unity Editor through `unity command script eval`. Automated skill scanners flag that as a powerful capability. It is intentional, and it is limited by the safeguards below.
4
+
5
+ ## Accepted risks
6
+
7
+ | Risk | Capability | Why it is accepted |
8
+ |---|---|---|
9
+ | `SEC_POWER_CAP` | Runs C# in the user's open Editor through `unity command script eval` | It only reaches the Editor the user already has open, on their own machine, as that user, so it grants nothing they couldn't do themselves. `script eval` sits behind the Pipeline capability gate. No code fetched from a remote source is run. Where a named `unity command` covers a step, the skill uses that instead of `script eval`. |
10
+
11
+ ## Mitigations
12
+
13
+ - **Only the user's own Editor.** `unity command script eval` talks to the Editor open on this machine. It can't reach another machine or another user's Editor.
14
+ - **Capability gate.** `script eval` is only available when the project's Pipeline package provides it.
15
+ - **No remote code.** The agent runs C# it writes from this skill's own recipes. Nothing downloaded from outside is executed.
16
+ - **Named commands first.** When a dedicated `unity command` covers a step, the skill uses it instead of `script eval`.
@@ -0,0 +1,120 @@
1
+ ---
2
+ name: optimize-audio
3
+ description: Optimizes audio memory, CPU cost, and playback quality through import settings and mixer configuration. Use when asked to reduce audio memory or Audio Mixer CPU cost, change clip Load Types, sample rates or codecs, or force 3D audio to mono.
4
+ ---
5
+ ## Critical Rules
6
+
7
+ - Do not make changes before reporting findings to the user
8
+ - Follow steps in strict order; never jump ahead
9
+ - STOP at every `WAIT` checkpoint and await the user's response before continuing
10
+ - Quality is more important than speed: measure before and after every change
11
+ - Always verify results in a device build; Editor audio stats are indicative only
12
+
13
+ ## 0. Set up the execution path
14
+
15
+ Every C# step below runs inside a live Editor through the Unity CLI. **The `unity-cli` skill owns
16
+ getting you there** — installing the CLI, confirming a connected Editor, adding the project's
17
+ `com.unity.pipeline` package, telling a genuinely absent Editor apart from one stuck in Safe Mode,
18
+ and discovering the Editor's command catalog. Follow it first; don't re-derive any of it here.
19
+
20
+ Two things it can't know for you:
21
+
22
+ - **You need `script eval` in particular**, not just a reachable Editor. Confirm it appears in the
23
+ catalog. Its presence depends on the Pipeline package version, not on the CLI, so a healthy
24
+ install can still lack it — if it's missing, say so and stop.
25
+ - **Do not hand-edit `.meta` files to change import settings.** Importer values only take effect
26
+ through `SaveAndReimport()` in a live Editor, so an unreachable Editor is a stop, not a cue to
27
+ edit metadata directly.
28
+
29
+ Run C# with `unity command script eval --caller plugin --skill optimize-audio --code '<snippet>'`. Discover the parameter shape from
30
+ `unity command --format json` rather than assuming one. `unity command` defaults to a 30 second
31
+ timeout.
32
+
33
+ ### Passing C# to `script eval`
34
+
35
+ `script eval` compiles a **statement block, not a file**. Two consequences, both of which cause a compile
36
+ error rather than a warning:
37
+
38
+ - **No `using` directives.** The compiler reads `using UnityEngine;` as a resource-disposal
39
+ statement and rejects it (`CS0210`).
40
+ - **Types must be fully qualified.** A bare `AssetDatabase` or `AudioImporter` does not resolve
41
+ (`CS0246` / `CS0103`), and a bare `Object` is ambiguous with `object` (`CS0104`).
42
+
43
+ The recipes in [resources/audio-import-api.md](resources/audio-import-api.md) are written
44
+ fully qualified so they can be passed to `script eval` as-is.
45
+
46
+ ## 1. Pre-Flight: Detect Audio System
47
+
48
+ Before doing anything else, establish the audio environment:
49
+
50
+ 1. **Detect platform and sample rate:** Use `script eval` to read `EditorUserBuildSettings.activeBuildTarget` and `AudioSettings.outputSampleRate`. The output sample rate affects whether overriding clip sample rates will actually save memory.
51
+ 2. **Detect AudioMixer presence:** Use the mixer-asset query recipe in [resources/audio-import-api.md](resources/audio-import-api.md) to see if a mixer graph exists. If none exists, note that routing and effect costs are not a concern.
52
+ 3. **Detect AudioListener:** Use the scene-component query recipe in [resources/audio-import-api.md](resources/audio-import-api.md) for `UnityEngine.AudioListener` to confirm exactly one listener is present. Multiple listeners produce incorrect spatialization; zero listeners produce silence.
53
+ 4. **Proceed** only after platform and listener state are confirmed.
54
+
55
+ ## 2. Assess Current State
56
+
57
+ Before recommending any change, gather observable data:
58
+
59
+ 1. **Find all AudioSources:** Use the scene-component query recipe in [resources/audio-import-api.md](resources/audio-import-api.md) for `UnityEngine.AudioSource`. For each result, use **one** `script eval` call to batch-read properties — see the batch read recipe in [resources/audio-import-api.md](resources/audio-import-api.md).
60
+ 2. **Inspect mixer topology:** If a mixer was found in Pre-Flight, use `script eval` to read the AudioMixer's exposed parameters and group count. A group count above ~8 or effects on the Master group are immediate flags.
61
+ 3. **Check DSP buffer size:** Use the DSP buffer recipe in [resources/audio-import-api.md](resources/audio-import-api.md) to read buffer size. See DSP Buffer Size Guidelines in [resources/platform-settings.md](resources/platform-settings.md) for recommended values.
62
+ 4. **Report findings before making changes:** Summarize ALL detected sources, the listener count, and mixer depth to the user. Flag any immediate risks (e.g., stereo clip with `spatialBlend = 1`, Decompress On Load on a clip > 1 MB, reverb on the Master group).
63
+
64
+ **WAIT for the user to review the assessment before proceeding.**
65
+
66
+ ## 3. Understand Request
67
+
68
+ Route to the correct section based on what the user needs:
69
+
70
+ | User Says | Path |
71
+ |-----------|------|
72
+ | "audio memory too high" / "memory profiler shows audio" | Section 4 — Import settings audit |
73
+ | "load times slow" / "decompression stall" | Section 4 — Load Type review |
74
+ | "DSP spike" / "mixer CPU" / "audio CPU high" | Section 4B — Mixer audit |
75
+ | "3D sound wrong" / "only left channel plays" / "stereo in 3D" | Section 4A — Force To Mono + spatial settings |
76
+ | "quality artifacts" / "voice sounds bad" / "Vorbis crackling" | Section 4C — Compression quality tuning |
77
+ | "mobile audio battery" / "mobile memory" | Section 4D — Mobile sample rate override |
78
+ | "set import settings on all clips" / "batch audio settings" | Section 4 — Bulk import audit |
79
+ | "streaming" / "background loading" / "Addressables audio" | Section 4E — Streaming and async load |
80
+
81
+ If the symptom is ambiguous, ask: "Is the problem audio memory usage, DSP CPU spikes, or audio playback quality?"
82
+
83
+ ## 4. Primary Diagnostic Workflow
84
+
85
+ Use the findings from Section 2 to determine which sub-section applies. More than one may apply simultaneously.
86
+
87
+ ## 4. Primary Diagnostic Workflow
88
+
89
+ Force-to-mono and spatial settings, the mixer audit, compression tuning, mobile sample-rate overrides, and load-type decisions: [references/diagnostics.md](references/diagnostics.md).
90
+ ## 5. Validation
91
+
92
+ After any import setting or mixer change:
93
+
94
+ 1. **Re-read clip stats:** Use `script eval` to re-read `clip.loadType`, `clip.channels`, `AudioSettings.outputSampleRate`, and the importer's `compressionFormat` to confirm the change applied after reimport.
95
+ 2. **Confirm AudioSource routing:** Use the scene-component query recipe for `UnityEngine.AudioSource` and verify `audioSource.outputAudioMixerGroup` is assigned as expected after any mixer restructure.
96
+ 3. **Report delta:** State the before and after values for each setting changed. Do not assume the change was effective without reading back the applied importer values.
97
+ 4. **Iterate limit:** Maximum 3 adjust-and-verify cycles before pausing to ask the user for feedback.
98
+
99
+ ## 6. Troubleshooting
100
+
101
+ Symptom → cause → fix for the audio problems this skill covers: [references/troubleshooting.md](references/troubleshooting.md).
102
+ ## 7. Completion
103
+
104
+ After finishing the audit or optimization:
105
+
106
+ - Summarize every setting changed with before/after values.
107
+ - List any clips or groups that still need attention (e.g., clips that require on-device measurement to confirm savings).
108
+ - If the user needs runtime memory measurement, point them at the Memory Profiler package, which reports the largest AudioClips by runtime byte cost.
109
+ - If mixer CPU is still high after the audit, point them at the Unity Profiler's Audio module for DSP thread profiling.
110
+
111
+ ## Detailed References
112
+
113
+ - **Platform settings, compression matrix, load types, sample rates:** [resources/platform-settings.md](resources/platform-settings.md)
114
+ - **AudioImporter API recipes and code patterns:** [resources/audio-import-api.md](resources/audio-import-api.md)
115
+
116
+ ## See Also
117
+
118
+ - **Memory Profiler package** — finds the largest AudioClips by runtime byte cost.
119
+ - **Unity Profiler, Audio module** — DSP CPU markers and frame-time budget.
120
+ - `audio-setup-mixers` — creating mixers and routing Audio Sources into groups.
@@ -0,0 +1,42 @@
1
+ # 4A. Force To Mono and Spatial Settings
2
+
3
+ For any AudioSource where `spatialBlend > 0` (3D positioned sound):
4
+
5
+ 1. **Check clip channel count:** Use `script eval` to read `audioSource.clip.channels`. If `channels == 2` and `spatialBlend == 1`, only the left channel plays — this is a bug, not a feature.
6
+ 2. **Recommend Force To Mono:** Use the read importer recipe in [resources/audio-import-api.md](../resources/audio-import-api.md) to inspect current settings, then apply Force To Mono using the force-to-mono recipe.
7
+ 3. **Apply and reimport:** Report before/after channel counts to the user.
8
+ 4. **Verify spatial blend:** Use `script eval` to confirm `audioSource.spatialBlend` is `1.0` (full 3D) and `audioSource.rolloffMode` is set to an appropriate curve.
9
+
10
+ # 4B. AudioMixer Audit
11
+
12
+ 1. **Measure group depth:** Use `script eval` to walk the mixer's group tree and count levels. More than 3 levels (Master → SFX / Music / Voice → sub-bus) adds routing overhead every frame, even when children are silent.
13
+ 2. **Check effects on silent groups:** Use `script eval` to query each group's effects list. Effects such as `AudioReverbFilter` run their DSP at full cost even when no AudioSource routes to that group.
14
+ 3. **Flag SFX Reverb on parent groups:** This is the most expensive built-in effect. If found on the Master or a high-level group, flag it explicitly.
15
+ 4. **Present recommendations to the user:**
16
+ - Remove or bypass effects on groups that have no active sources.
17
+ - Use **snapshots** to switch mix states (combat / explore / pause) rather than toggling effects at runtime.
18
+ - Flatten unnecessary sub-buses; redirect sources to a shallower ancestor.
19
+
20
+ **WAIT for the user to approve the mixer changes before applying.**
21
+
22
+ 5. **Verify DSP buffer size:** If `bufferLength` from Pre-Flight is very small (< 256), recommend increasing it — see DSP Buffer Size Guidelines in [resources/platform-settings.md](../resources/platform-settings.md).
23
+
24
+ # 4C. Compression Quality Tuning
25
+
26
+ 1. **Read current compression format:** Use the read importer recipe in [resources/audio-import-api.md](../resources/audio-import-api.md) to read `compressionFormat` and `quality` for the clips reported by the user.
27
+ 2. **Apply the platform matrix:** See the Compression Format Matrix in [resources/platform-settings.md](../resources/platform-settings.md) for per-platform recommendations.
28
+ 3. **Warn about lossy sources:** Use the lossy source check recipe in [resources/audio-import-api.md](../resources/audio-import-api.md). If the original file is MP3, warn the user that lossy source quality is lost permanently after Unity re-encodes. Recommend WAV or AIFF sources.
29
+
30
+ # 4D. Mobile Sample Rate Override
31
+
32
+ 1. **Identify SFX clips on mobile target:** Use the scene-component query recipe for `UnityEngine.AudioSource` and filter for non-music, non-dialogue clips.
33
+ 2. **Read current sample rate setting:** Use the read importer recipe in [resources/audio-import-api.md](../resources/audio-import-api.md) to read `sampleRateSetting` and `sampleRateOverride` for each clip.
34
+ 3. **Apply mobile override:** Use the sample rate override recipe in [resources/audio-import-api.md](../resources/audio-import-api.md). See Sample Rate Recommendations in [resources/platform-settings.md](../resources/platform-settings.md) for per-use-case rates.
35
+ 4. **Report savings:** Halving the sample rate halves the PCM memory cost. Report the estimated saving for each clip changed.
36
+
37
+ # 4E. Load Type and Streaming
38
+
39
+ 1. **Audit Load Type per clip:** Use `script eval` to read `clip.loadType` for each clip found in Section 2.
40
+ 2. **Apply the decision rule:** See Load Type Decision Table in [resources/platform-settings.md](../resources/platform-settings.md).
41
+ 3. **Flag mismatches:** See Load Type Mismatch Flags in [resources/platform-settings.md](../resources/platform-settings.md). Report both types of mismatches to the user.
42
+ 4. **Apply `Load In Background`** for any Streaming clip — use the Load In Background recipe in [resources/audio-import-api.md](../resources/audio-import-api.md).
@@ -0,0 +1,41 @@
1
+ # 6. Troubleshooting
2
+
3
+ ## Stereo clip on a 3D AudioSource — only left channel audible
4
+
5
+ 1. Confirm `audioSource.spatialBlend == 1`.
6
+ 2. Confirm `audioSource.clip.channels == 2`.
7
+ 3. Enable `forceToMono` in the AudioClip importer and reimport. Unity mixes both channels to mono during import, preserving level with `normalize = true` (keep on).
8
+ 4. If the user does not want to reimport: set `audioSource.panStereo = 0` as a runtime workaround, but warn this does not recover stereo information.
9
+
10
+ ## Decompress On Load clip causes memory spike
11
+
12
+ 1. Confirm `clip.loadType == AudioClipLoadType.DecompressOnLoad` and `clip.length` is long (> 5 s).
13
+ 2. Switch to `Streaming` if it is music or ambience, `CompressedInMemory` if played only occasionally.
14
+ 3. If the clip is short but still large: check `clip.channels` (stereo wastes double the memory) and `clip.frequency` (high sample rate on a mobile target wastes memory). Apply Force To Mono and/or sample rate override.
15
+
16
+ ## AudioMixer CPU spike — DSP thread hot
17
+
18
+ 1. Confirm with the mixer-asset query recipe that the mixer graph exists.
19
+ 2. Use `script eval` to list all groups and their attached effects. Look for reverb, chorus, or EQ on high-level groups.
20
+ 3. Move expensive effects down to leaf groups that are only active when sources are playing.
21
+ 4. Use snapshots to bypass effect chains during gameplay states where they are not heard (e.g., bypass reverb during a menu).
22
+ 5. If the DSP buffer is small (64 or 128 samples), raise it — see DSP Buffer Size Guidelines in [resources/platform-settings.md](../resources/platform-settings.md).
23
+
24
+ ## Vorbis quality artifacts on dialogue
25
+
26
+ 1. Confirm `defaultSampleSettings.compressionFormat == AudioCompressionFormat.Vorbis`.
27
+ 2. Confirm `defaultSampleSettings.quality` — default is 0.5, which is often audible on voice. Raise to 0.7–0.85.
28
+ 3. On iOS: switch to AAC instead of Vorbis (hardware decode, better quality at equivalent bitrate).
29
+ 4. Confirm the source file is lossless (WAV or AIFF). MP3 sources cannot recover quality lost before Unity's re-encode.
30
+
31
+ ## AudioListener count is not exactly one
32
+
33
+ - **Zero listeners:** All audio will be silent. Use `script eval` to add an `AudioListener` component to the main camera: `UnityEngine.Camera.main.gameObject.AddComponent<UnityEngine.AudioListener>()`.
34
+ - **Multiple listeners:** Unity uses the last enabled one, producing unpredictable spatialization. Use the scene-component query recipe for `UnityEngine.AudioListener` and disable all but the intended one.
35
+
36
+ ## `Load In Background` causes first-play silence
37
+
38
+ This is expected behavior: the clip has not finished loading when `Play()` is first called. Mitigate with:
39
+ 1. Preload the clip at scene start by calling `clip.LoadAudioData()` before it is needed.
40
+ 2. Use `AudioSource.PlayScheduled()` with a slight delay to allow async load to complete.
41
+ 3. For AudioSources that must play immediately: switch to `CompressedInMemory` (synchronous on first play) rather than `Streaming` with background load.
@@ -0,0 +1,149 @@
1
+ # Audio Import API Recipes
2
+
3
+ C# code recipes for `unity command script eval --caller plugin --skill optimize-audio --code '<snippet>'`. All examples target the Unity 6
4
+ AudioImporter API.
5
+
6
+ `script eval` compiles a statement block, so there are no `using` directives and every type is written
7
+ fully qualified. Each recipe `return`s its result as a string rather than calling `Debug.Log`, so
8
+ the value comes back on the CLI's stdout instead of only reaching the Editor console.
9
+
10
+ ## Read AudioClip Importer Settings
11
+
12
+ ```csharp
13
+ var path = UnityEditor.AssetDatabase.GetAssetPath(audioSource.clip);
14
+ var importer = (UnityEditor.AudioImporter)UnityEditor.AssetImporter.GetAtPath(path);
15
+ return $"forceToMono={importer.forceToMono}, loadType={importer.defaultSampleSettings.loadType}, " +
16
+ $"compressionFormat={importer.defaultSampleSettings.compressionFormat}, " +
17
+ $"quality={importer.defaultSampleSettings.quality}, " +
18
+ $"sampleRateSetting={importer.defaultSampleSettings.sampleRateSetting}, " +
19
+ $"sampleRateOverride={importer.defaultSampleSettings.sampleRateOverride}");
20
+ ```
21
+
22
+ ## Force To Mono and Reimport
23
+
24
+ ```csharp
25
+ var path = UnityEditor.AssetDatabase.GetAssetPath(audioSource.clip);
26
+ var importer = (UnityEditor.AudioImporter)UnityEditor.AssetImporter.GetAtPath(path);
27
+ importer.forceToMono = true;
28
+ importer.SaveAndReimport();
29
+ return $"Reimported {path} — channels now: {audioSource.clip.channels}");
30
+ ```
31
+
32
+ ## Set Load Type
33
+
34
+ ```csharp
35
+ var path = UnityEditor.AssetDatabase.GetAssetPath(audioSource.clip);
36
+ var importer = (UnityEditor.AudioImporter)UnityEditor.AssetImporter.GetAtPath(path);
37
+ var settings = importer.defaultSampleSettings;
38
+ settings.loadType = UnityEngine.AudioClipLoadType.Streaming; // or CompressedInMemory, DecompressOnLoad
39
+ importer.defaultSampleSettings = settings;
40
+ importer.SaveAndReimport();
41
+ ```
42
+
43
+ ## Enable Load In Background
44
+
45
+ ```csharp
46
+ var path = UnityEditor.AssetDatabase.GetAssetPath(audioSource.clip);
47
+ var importer = (UnityEditor.AudioImporter)UnityEditor.AssetImporter.GetAtPath(path);
48
+ importer.loadInBackground = true;
49
+ importer.SaveAndReimport();
50
+ ```
51
+
52
+ ## Set Compression Format and Quality
53
+
54
+ ```csharp
55
+ var path = UnityEditor.AssetDatabase.GetAssetPath(audioSource.clip);
56
+ var importer = (UnityEditor.AudioImporter)UnityEditor.AssetImporter.GetAtPath(path);
57
+ var settings = importer.defaultSampleSettings;
58
+ settings.compressionFormat = UnityEngine.AudioCompressionFormat.Vorbis;
59
+ settings.quality = 0.7f; // 0.0–1.0; raise to 0.7–0.85 for dialogue
60
+ importer.defaultSampleSettings = settings;
61
+ importer.SaveAndReimport();
62
+ ```
63
+
64
+ ## Override Sample Rate (Mobile)
65
+
66
+ ```csharp
67
+ var path = UnityEditor.AssetDatabase.GetAssetPath(audioSource.clip);
68
+ var importer = (UnityEditor.AudioImporter)UnityEditor.AssetImporter.GetAtPath(path);
69
+ var settings = importer.defaultSampleSettings;
70
+ settings.sampleRateSetting = UnityEditor.AudioSampleRateSetting.OverrideSampleRate;
71
+ settings.sampleRateOverride = 22050u;
72
+ importer.defaultSampleSettings = settings;
73
+ importer.SaveAndReimport();
74
+ ```
75
+
76
+ ## Read AudioSource Properties (Batch)
77
+
78
+ Read multiple properties in a single `script eval` call:
79
+
80
+ ```csharp
81
+ var src = audioSource;
82
+ return $"clip={src.clip?.name}, loadType={src.clip?.loadType}, " +
83
+ $"channels={src.clip?.channels}, frequency={src.clip?.frequency}, " +
84
+ $"spatialBlend={src.spatialBlend}, rolloff={src.rolloffMode}, " +
85
+ $"mixerGroup={src.outputAudioMixerGroup?.name ?? "None"}, " +
86
+ $"bypassEffects={src.bypassEffects}");
87
+ ```
88
+
89
+ ## Read DSP Buffer Size
90
+
91
+ ```csharp
92
+ UnityEngine.AudioSettings.GetDSPBufferSize(out int bufferLength, out int numBuffers);
93
+ return $"DSP buffer: {bufferLength} samples x {numBuffers} buffers");
94
+ ```
95
+
96
+ ## Check Source File Format (Lossy Warning)
97
+
98
+ ```csharp
99
+ var path = UnityEditor.AssetDatabase.GetAssetPath(clip);
100
+ if (path.EndsWith(".mp3", System.StringComparison.OrdinalIgnoreCase))
101
+ return $"'{clip.name}' is MP3 — lossy source quality is lost permanently after Unity re-encodes. Recommend WAV or AIFF sources.");
102
+ ```
103
+
104
+ ## Resolving `audioSource` / `clip` inside a snippet
105
+
106
+ The recipes above are written against an `audioSource` or `clip` variable. `script eval` runs each
107
+ snippet in a fresh scope, so nothing carries over between calls — resolve the object at the top of
108
+ the same snippet that uses it.
109
+
110
+ By scene object:
111
+
112
+ ```csharp
113
+ var sources = UnityEngine.Object.FindObjectsByType<UnityEngine.AudioSource>(
114
+ UnityEngine.FindObjectsInactive.Include, UnityEngine.FindObjectsSortMode.None);
115
+ var audioSource = System.Array.Find(sources, s => s.gameObject.name == "TheGameObjectName");
116
+ ```
117
+
118
+ By asset path, when you already know the clip:
119
+
120
+ ```csharp
121
+ var clip = UnityEditor.AssetDatabase.LoadAssetAtPath<UnityEngine.AudioClip>("Assets/Audio/Foo.wav");
122
+ ```
123
+
124
+ ## Enumerate scene components
125
+
126
+ Substitute the component type (`UnityEngine.AudioSource`, `UnityEngine.AudioListener`). Inactive
127
+ objects are included deliberately — a disabled second listener still counts against the
128
+ one-listener rule.
129
+
130
+ ```csharp
131
+ var found = UnityEngine.Object.FindObjectsByType<UnityEngine.AudioSource>(
132
+ UnityEngine.FindObjectsInactive.Include, UnityEngine.FindObjectsSortMode.None);
133
+ var names = System.Linq.Enumerable.Select(found, c => c.gameObject.name);
134
+ return $"count={found.Length}: {string.Join(", ", names)}";
135
+ ```
136
+
137
+ ## Enumerate mixer assets
138
+
139
+ An `AudioMixer` is a project asset, not a scene object, so it is found through the asset database
140
+ rather than a scene query.
141
+
142
+ ```csharp
143
+ // Scope to Assets. Unscoped, FindAssets also walks read-only packages and reports mixers the
144
+ // user did not author. The second parameter is string[] searchInFolders; there is no SearchMode
145
+ // overload. Measured on one project: t:Material returned 81 unscoped against 9 under Assets.
146
+ var guids = UnityEditor.AssetDatabase.FindAssets("t:AudioMixer", new[] { "Assets" });
147
+ var paths = System.Linq.Enumerable.Select(guids, UnityEditor.AssetDatabase.GUIDToAssetPath);
148
+ return $"count={guids.Length}: {string.Join(", ", paths)}";
149
+ ```
@@ -0,0 +1,48 @@
1
+ # Audio Platform Settings Reference
2
+
3
+ ## Compression Format Matrix
4
+
5
+ | Platform | Recommended Format | Notes |
6
+ |---|---|---|
7
+ | PC / cross-platform | Vorbis, quality 0.5–0.7 | Raise to 0.7–0.85 for dialogue; default 0.5 often adds artifacts |
8
+ | iOS | AAC | Hardware decode; cheapest CPU |
9
+ | Android | Vorbis | Software decode |
10
+ | Xbox | XMA | Use platform override in import settings |
11
+ | PlayStation | ATRAC9 | Use platform override in import settings |
12
+ | Web | Vorbis | Browser handles decode |
13
+
14
+ ## Sample Rate Recommendations
15
+
16
+ | Use Case | Recommended Rate |
17
+ |---|---|
18
+ | PC / console music and voice | 44100 Hz |
19
+ | PC / console SFX | 44100 Hz |
20
+ | Mobile SFX | 22050 Hz |
21
+ | Mobile dialogue | 22050 or 44100 Hz |
22
+ | UI clicks / blips | 22050 Hz |
23
+
24
+ Halving the sample rate halves the PCM memory cost. Always report the estimated saving for each clip changed.
25
+
26
+ ## Load Type Decision Table
27
+
28
+ | Load Type | Behavior | Use For |
29
+ |---|---|---|
30
+ | Decompress On Load | PCM in memory at load; zero per-play CPU | Short SFX < 200 KB (uncompressed) |
31
+ | Compressed In Memory | Stays compressed; decompresses on play | Medium clips played occasionally |
32
+ | Streaming | Streams from disk; minimal RAM, higher disk I/O | Music, long ambience, voice-overs |
33
+
34
+ ### Load Type Mismatch Flags
35
+
36
+ - **Decompress On Load** on a clip > 1 MB bloats memory.
37
+ - **Streaming** on a clip that plays dozens of times simultaneously adds disk pressure.
38
+ - Always apply `Load In Background` for any Streaming clip to prevent the main thread stalling on first play.
39
+
40
+ ## DSP Buffer Size Guidelines
41
+
42
+ | Setting | Buffer Size | Use Case |
43
+ |---|---|---|
44
+ | Best Latency | 256 | Rhythm games, real-time synthesis |
45
+ | Good Latency | 512 | General gameplay |
46
+ | Best Performance | 1024 | Ambient/cinematic, battery-saving |
47
+
48
+ A very small buffer (64 or 128) costs more CPU per frame. If `bufferLength` is < 256, recommend increasing to "Good Latency" or "Best Performance" to trade latency for CPU stability.
@@ -0,0 +1,181 @@
1
+ ---
2
+ name: optimize-text-mesh-pro
3
+ description: Optimizes TextMeshPro rendering, memory, and font setup, including font asset stacks, fallback atlases, SDF quality, and worldspace text. Use when the user asks about TextMeshPro font assets, CJK font fallbacks, or TMP memory, build size, quality or performance, not about translating text.
4
+ ---
5
+
6
+ # Optimize TextMeshPro
7
+
8
+ ## Important
9
+
10
+ - Use the unity cli (`unity command --format json`) and the `unity-cli` and `unity-pipeline` skills for each step.
11
+ - Create a restore point you can roll back to if your changes fail.
12
+ - Do only what's asked. Don't change unrelated assets or files.
13
+ - Don't use `using` directives or unqualified types in the `snippet` for `eval`. The compiler reads `using UnityEngine` and a bare `AssetDatabase`, `Volume`, or `Object` causes errors (CS0246 / CS0103 / CS0104). `return` what you want to read; it arrives at `data.result.result`.
14
+ - Never leave verification code in the user's script; never build logging or detection they didn't ask for. See [Final step](#final-step).
15
+ - Avoid long explanations.
16
+
17
+ First, read the Unity version from `ProjectSettings/ProjectVersion.txt` and the `com.unity.ugui` or `com.unity.textmeshpro` version from `Packages/packages-lock.json`, because the doc URLs and some advice depend on them. For example, before you recommend Dynamic OS, check that `TMPro.AtlasPopulationMode.DynamicOS` exists in the installed package's [API reference](#api-reference), because older `com.unity.textmeshpro` versions don't have it.
18
+
19
+ Before you go forward with a workflow or diagnosis:
20
+
21
+ 1. Open and read the [documentation page(s)](#full-topic-map) that cover the specific subject related to what you intend to do or fix and check if you've missed anything.
22
+ 2. Name the file(s) you read in your response.
23
+
24
+ This is because your training knowledge about Unity might be out of date, incorrect, or for the wrong Unity version.
25
+
26
+ Prefer `WebFetch` over `WebSearch` — faster and lands on the exact reference. Only fetch what you need. Replace `<VERSION>` with the following before fetching:
27
+
28
+ - **Package on docs.unity3d.com**: The package version, eg `@6.6` or `@2.0`. Check the package version if unsure.
29
+ - **Engine on docs.unity.com**: The Unity version, eg `6000.3`
30
+
31
+ For TextMeshPro, if `com.unity.ugui` is 2.0 or later, TMP is part of uGUI and its docs are in the `com.unity.ugui` package; otherwise they are in the `com.unity.textmeshpro` package. Use the one listed in `Packages/packages-lock.json`.
32
+
33
+ ## Full topic map
34
+
35
+ Docs pages, API entry points, and glossary: [references/topic-map.md](references/topic-map.md).
36
+
37
+ ## API reference
38
+
39
+ Read [API reference](references/topic-map.md#api-reference) before relying on a class or method name.
40
+
41
+ ## Workflow
42
+
43
+ 1. Read the Unity version and the `com.unity.ugui` or `com.unity.textmeshpro` version, as described above.
44
+ 2. Read the doc pages that cover the area you'll work on, as described above.
45
+ 3. Identify the symptom with the [Triage](#triage--identify-the-symptom-first) table, asking the user if they haven't described one.
46
+ 4. Follow the matching section. Give advice by default, and change settings only when the user asks you to, because many of these settings change memory use or build size for the whole project. Before you change anything, create a restore point.
47
+ 5. Run the [Final step](#final-step), then give the [Final report](#final-report).
48
+
49
+ ## Triage — identify the symptom first
50
+
51
+ Before providing tips, identify which category the user's issue falls into. If the user has not described a specific symptom, ask: "Are you seeing a **memory/atlas bloat**, **visual quality**, **CPU/performance**, **build size**, or **localization/alignment** issue with TextMeshPro?"
52
+
53
+ | Symptom | Go To |
54
+ |---|---|
55
+ | Memory Profiler shows large or multiple TMP atlases | [Font Stack & Dynamic Fallbacks](#font-stack--dynamic-fallbacks), [Memory Profiler: Include Font Data](#memory-profiler-include-font-data) |
56
+ | Inconsistent glyph weight, fuzzy edges, visual quality | [Padding & Sampling Ratios](#padding--sampling-ratios), [Font Asset Scale](#font-asset-scale), [Atlas Render Mode: SDF16](#atlas-render-mode-sdf16) |
57
+ | CPU spikes during text updates or Canvas rebuilds | [AutoSize](#autosize), [Worldspace vs Canvas Text](#worldspace-vs-canvas-text) |
58
+ | Build size too large from shipped font files | [Dynamic OS Atlas Population](#dynamic-os-atlas-population) |
59
+ | Mixed Latin + CJK alignment looks off | [Font Normalization](#font-normalization) |
60
+ | Need multiple font styles (italic, outline, glow) | [Material Presets](#material-presets) |
61
+
62
+ ---
63
+
64
+ ## Core Rules
65
+
66
+ - **Main font = static asset with all glyphs baked in.** Add **dynamic** fallbacks to the font asset's own Fallback list for everything else, not the global list in TMP Settings, unless every font in the project should share them (see `FontAssetsFallback.md`). Keep dynamic atlas size at **512-1024** to bound peak memory.
67
+ - **Dynamic fallback fonts -> enable `Clear Dynamic Data On Build`.** Otherwise editor-baked glyphs ship in the player.
68
+ - **Keep Padding-to-Sampling-Point-Size ratio consistent across primary + fallback fonts.** Mismatch produces inconsistent glyph weight on the same line.
69
+ - **Latin sampling point size 70-90; CJK 36-50.** Different scripts need different sampling sizes for clean SDF.
70
+ - **Font asset Scale = 1.** Anything else (e.g., 0.9) breaks standard point-size math.
71
+ - **Disable AutoSize at runtime once layout is locked.** AutoSize is for design, not for live counters.
72
+ - **Worldspace text -> use `TextMeshPro`, not `TextMeshProUGUI`.** Canvas overhead in worldspace is not free.
73
+ - **Parent often-changing TMP UI to its own Canvas** to bound rebuild cost.
74
+ - **TMP material presets > duplicating font assets** for italic / bold / outline / glow variants of the same font.
75
+ - **For shipping multilingual builds on iOS/Android, evaluate `Atlas Population Mode = Dynamic OS`** to leverage system fonts and shrink the build.
76
+
77
+ ---
78
+
79
+ ## Font Stack & Dynamic Fallbacks
80
+
81
+ If the user reports memory bloat from TMP atlases, advise this font stack pattern:
82
+
83
+ ```
84
+ Main font asset (static, all required Latin glyphs baked)
85
+ -> Fallback 1: Dynamic font (atlas 512 or 1024) for CJK
86
+ -> Fallback 2: Dynamic font for symbols / emoji
87
+ ```
88
+
89
+ Don't use one dynamic font asset for every language, because its atlas keeps growing with every glyph the game uses. Check `Clear Dynamic Data On Build` on each dynamic fallback, as the Core Rules say (see `FontAssets.md`).
90
+
91
+ ---
92
+
93
+ ## Padding & Sampling Ratios
94
+
95
+ If the user reports inconsistent stroke widths or glyph weight differences between primary and fallback fonts, check the padding-to-sampling-point-size ratio.
96
+
97
+ The ratio is `Padding / SamplingPointSize`. With Padding = 9 and Sampling Point Size = 90, ratio = **10%**.
98
+
99
+ - A primary font with one ratio and a fallback with a different ratio produces **inconsistent stroke widths** on the same line.
100
+ - Pick a ratio (10% is a safe default), apply it to all font assets in the chain.
101
+
102
+ Recommended sampling point sizes:
103
+
104
+ - **Latin scripts**: 70-90.
105
+ - **CJK scripts**: 36-50 (CJK glyphs are visually denser; smaller sampling sizes still produce clean SDF and save atlas memory).
106
+
107
+ ---
108
+
109
+ ## Font Asset Scale
110
+
111
+ If the user reports point sizes not matching design specs, check the font asset Scale value. Some imported TMP font assets ship with `Scale = 0.9` instead of `1.0`. A non-1 Scale changes every rendered point size (see `FontAssetsProperties.md`). Advise the user to **set Scale = 1 on all font assets before adjusting padding ratios**.
112
+
113
+ ---
114
+
115
+ ## Sprite Assets
116
+
117
+ For the source texture settings a Sprite Asset needs, read `Sprites.md` (see the [Full topic map](#full-topic-map)). If the user reports slow loading times for TMP Sprite Assets on mobile, check the source texture's Texture Type, and suggest setting it back to **Default** once the Sprite Asset is created, because Sprite type keeps child sprite sub-objects that TMP doesn't use.
118
+
119
+ ---
120
+
121
+ ## AutoSize
122
+
123
+ If the user reports CPU spikes on text fields that change frequently (timers, counters, chat, dynamic player names), check whether `enableAutoSizing` is on. AutoSize resizes the text whenever the string changes, causing constant CPU spikes.
124
+
125
+ Advise: **disable AutoSize and hard-code the chosen point size** once layout is locked. Keep AutoSize on only for genuinely static labels that auto-fit on locale change.
126
+
127
+ ---
128
+
129
+ ## Atlas Render Mode: SDF16
130
+
131
+ If a static font with point size **72 or larger** looks unclear or has fuzzy edges, advise switching the **Atlas Render Mode** to **SDF16**. Higher precision SDF for big glyphs, at slightly more atlas memory.
132
+
133
+ ---
134
+
135
+ ## Font Normalization
136
+
137
+ If the user reports misaligned Latin + CJK text on the same line, compare the line metrics of the primary and fallback font assets, and advise adjusting the fallback's ascender and descender until they match the primary's. Read `FontAssetsLineMetrics.md` (see the [Full topic map](#full-topic-map)) for what each metric controls.
138
+
139
+ To show the lines in the scene, the `TMP_TextInfoDebugTool` component from TMP Examples & Extras draws them. Ask the user before importing Examples & Extras, because it adds unrelated example assets to the project.
140
+
141
+ ---
142
+
143
+ ## Material Presets
144
+
145
+ If the user needs multiple styles (italic, bold, outline, glow) of the same font, advise material presets instead of duplicating font assets. Presets share the same font texture but override shader parameters. For the Material Preset property on the text component, read `TMPObjectUIText.md`, and for the shader settings a preset can override, read `Shaders.md` (see the [Full topic map](#full-topic-map)).
146
+
147
+ ---
148
+
149
+ ## Dynamic atlases, profiling, worldspace text
150
+
151
+ ### Dynamic OS Atlas Population
152
+
153
+ ### Memory Profiler: Include Font Data
154
+
155
+ ### Worldspace vs Canvas Text
156
+
157
+ Read [dynamic atlases, profiling, and worldspace text](references/dynamic-atlas-and-profiling.md) when build size, font-data memory, or worldspace Canvas text is in play.
158
+
159
+ ## Final step
160
+
161
+ Do the following checks:
162
+
163
+ 1. Check the project has zero console errors. Use `console_status` for counts.
164
+ 2. Stop there unless the user asked you to prove it works or you suspect a specific fault.
165
+ 3. If you do enter Play mode, do it once only to chase a fault you already suspect. Read the world through `eval` rather than adding logging. Take no screenshots as they take too much time.
166
+
167
+ If a check fails, go back and reread the [docs pages](#full-topic-map) to find out what you missed.
168
+
169
+ If you changed settings, also read them back through the API, because an Inspector or script change can fail to save. For example: `TMP_FontAsset.atlasPopulationMode`, `m_ClearDynamicDataOnBuild` (through `SerializedObject`), the font asset's `faceInfo.scale`, `enableAutoSizing` on the text component, `TrueTypeFontImporter.includeFontData`, and `TextureImporter.textureType` for a sprite source texture. If a value doesn't match what you set, set it again and read it back.
170
+
171
+ If you changed settings to reduce memory or build size, compare a measurable result before and after, because a saved setting doesn't prove the problem is gone. For example, record the number and dimensions of `TMP_FontAsset.atlasTextures` for each font asset in the stack before your change, and read them again after. If the result didn't improve, reread the [docs pages](#full-topic-map), and say so in the final report rather than claiming a fix.
172
+
173
+ ## Final report
174
+
175
+ Report the following, in this order:
176
+
177
+ 1. The symptom category, and each setting you recommended or changed, with the current and recommended values.
178
+ 2. The verification results from the final step, including the before and after measurements.
179
+ 3. Any side effects of your changes, such as Examples & Extras assets you imported or other assets that use a font asset you changed.
180
+ 4. Follow-up the user must do, such as testing Dynamic OS fonts on iOS and Android devices, or capturing a new Memory Profiler snapshot.
181
+ 5. The doc pages you read.
@@ -0,0 +1,28 @@
1
+ # Dynamic OS Atlas Population
2
+
3
+ If the user is shipping multilingual builds and concerned about build size, advise evaluating **`Atlas Population Mode = Dynamic OS`**. Read the Dynamic OS font asset section of [Font assets](https://docs.unity.com/en-us/engine/<VERSION>/manual/uitoolkits/uielements/uie-work-with-text/uie-font-asset/uie-font-asset.md) for what it changes in the build. The TMP package manual doesn't cover Dynamic OS, but this page covers the font assets that TMP and UI Toolkit share.
4
+
5
+ At runtime, Dynamic OS looks for a device font with the same Family and Style name as the source font, so choose a source font whose name exists on each target platform. Recommended system fonts for CJK:
6
+
7
+ | Platform | Recommended system font |
8
+ |---|---|
9
+ | **Android** | NotoSans (covers Chinese, Japanese, Korean glyphs broadly). |
10
+ | **iOS** | PingFang for Simplified/Traditional Chinese. iOS uses **unique fonts per language** for CJK (different families for Chinese, Japanese, Korean) - check the fallback chain when shipping a single TMP setup across all three. |
11
+
12
+ ---
13
+
14
+ # Memory Profiler: Include Font Data
15
+
16
+ If Memory Profiler shows unexpectedly large font asset sizes, check **Include Font Data** on the `.ttf` / `.otf` import settings. Read [TrueTypeFontImporter.includeFontData](https://docs.unity.com/en-us/engine/<VERSION>/script-reference/unityeditor/truetypefontimporter/includefontdata.md) for what it controls.
17
+
18
+ Keep it on for fonts that dynamic font assets use, because they generate glyphs from the font data at runtime. Don't turn it off just to make an Editor capture look like a device, because it changes what ships in the build. For build size, use static font assets or [Dynamic OS](#dynamic-os-atlas-population) instead.
19
+
20
+ ---
21
+
22
+ # Worldspace vs Canvas Text
23
+
24
+ If the user has worldspace text (damage numbers, signs, holograms) using `TextMeshProUGUI`, advise switching to **`TextMeshPro`**. Worldspace Canvas is a known inefficiency.
25
+
26
+ If a `TextMeshProUGUI` element's `text` changes often (timers, counters, chat), advise **parenting it under a child GameObject with its own Canvas component**. Canvas rebuilds are scoped per-Canvas, so isolating the volatile field cuts rebuild cost on the rest of the UI.
27
+
28
+ ---