@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,190 @@
1
+ // [UNITY-SKILL:SPRITEATLAS]
2
+ using UnityEditor;
3
+ using UnityEditor.U2D;
4
+
5
+ /// <summary>
6
+ /// Demonstrates why you should NOT pack atlases during runtime builds.
7
+ /// Packed atlases during build time are already optimized for the target platform.
8
+ /// </summary>
9
+ public static class DontPackInRuntimeBuildsDocumentation
10
+ {
11
+ /// <summary>
12
+ /// ❌ WRONG: Attempting to pack atlases during a runtime build.
13
+ /// This is unnecessary and can cause issues because:
14
+ /// 1. Atlases should be packed at editor time (prebuild)
15
+ /// 2. Runtime builds don't have access to all source assets
16
+ /// 3. It slows down the build process significantly
17
+ /// </summary>
18
+ public static void Wrong_PackDuringRuntimeBuild()
19
+ {
20
+ // This is WRONG - do not pack during runtime build
21
+
22
+ // ❌ BAD: Calling PackAtlases in a build callback
23
+ // public class MyBuildProcessor : IPostprocessBuildWithReport
24
+ // {
25
+ // public void OnPostprocessBuild(BuildTarget target, string path)
26
+ // {
27
+ // // Don't do this!
28
+ // SpriteAtlasUtility.PackAtlases(atlases, BuildTarget.NoAPI);
29
+ // }
30
+ // }
31
+
32
+ // ❌ BAD: Using SpriteAtlasUtility.PackAtlases in a runtime build
33
+ // This method is for editor preview only, not for build-time packing
34
+ }
35
+
36
+ /// <summary>
37
+ /// ❌ WRONG: Calling SaveAndReimport() during a build.
38
+ /// Modifying assets during build can cause unpredictable behavior.
39
+ /// </summary>
40
+ public static void Wrong_ModifyDuringBuild()
41
+ {
42
+ // This is WRONG - do not modify assets during build
43
+
44
+ // ❌ BAD: Saving asset database during build
45
+ // AssetDatabase.SaveAssets();
46
+ // AssetDatabase.ImportAsset(path);
47
+ // importer.SaveAndReimport(); // Don't do this in build!
48
+ }
49
+
50
+ /// <summary>
51
+ /// ✅ CORRECT: Pack atlases during prebuild, not runtime.
52
+ /// Use IPreprocessBuildWithReport to pack atlases before the build starts.
53
+ /// </summary>
54
+ public static void Correct_PackDuringPrebuild()
55
+ {
56
+ // ✅ CORRECT: Implement IPreprocessBuildWithReport for packing
57
+
58
+ /*
59
+ public class AtlasPacker : IPreprocessBuildWithReport
60
+ {
61
+ public int callbackOrder => 0;
62
+
63
+ public void OnPreprocessBuild(BuildTarget target, string path)
64
+ {
65
+ // Find and pack all atlases before build
66
+ string[] guids = AssetDatabase.FindAssets("t:SpriteAtlasAsset", new[] { "Assets" });
67
+ var atlases = new SpriteAtlasAsset[guids.Length];
68
+
69
+ for (int i = 0; i < guids.Length; i++)
70
+ {
71
+ atlases[i] = AssetDatabase.LoadAssetAtPath<SpriteAtlasAsset>(
72
+ AssetDatabase.GUIDToAssetPath(guids[i]));
73
+ }
74
+
75
+ // Pack is optional here - build-time packing happens automatically
76
+ // SpriteAtlasUtility.PackAtlases(atlases, BuildTarget.NoAPI);
77
+ }
78
+ }
79
+ */
80
+ }
81
+
82
+ /// <summary>
83
+ /// ✅ CORRECT: Use prebuild pipeline for atlas generation.
84
+ /// This is the recommended approach for all atlas operations.
85
+ /// </summary>
86
+ public static void Correct_UsePrebuildPipeline()
87
+ {
88
+ // ✅ Implement IPreprocessBuildWithReport for:
89
+ // - Atlas generation
90
+ // - Atlas configuration
91
+ // - Batch packing
92
+
93
+ /*
94
+ [InitializeOnLoad]
95
+ public class MyAtlasPreprocessor
96
+ {
97
+ static MyAtlasPreprocessor()
98
+ {
99
+ EditorApplication.wantsToQuit += () =>
100
+ {
101
+ // Clean up any temporary assets before quit
102
+ return true;
103
+ };
104
+ }
105
+ }
106
+
107
+ public class MyBuildProcessor : IPreprocessBuildWithReport
108
+ {
109
+ public int callbackOrder => 0;
110
+
111
+ public void OnPreprocessBuild(BuildTarget target, string path)
112
+ {
113
+ // Generate or update atlases here
114
+ // This runs BEFORE the build starts
115
+ }
116
+ }
117
+ */
118
+ }
119
+
120
+ /// <summary>
121
+ /// ✅ CORRECT: For runtime loading, use SpriteAtlasManager with late-binding.
122
+ /// Load atlases on-demand at runtime using Addressables or AssetBundles.
123
+ /// </summary>
124
+ public static void Correct_RuntimeLateBinding()
125
+ {
126
+ // ✅ Use SpriteAtlasManager for runtime atlas loading
127
+
128
+ /*
129
+ public class RuntimeAtlasLoader : MonoBehaviour
130
+ {
131
+ private void Awake()
132
+ {
133
+ // Register for late-binding
134
+ SpriteAtlasManager.atlasRegistrationNeeded += OnAtlasRegistrationNeeded;
135
+ }
136
+
137
+ private void OnAtlasRegistrationNeeded(Sprite sprite)
138
+ {
139
+ // Load the appropriate atlas using Addressables or AssetBundles
140
+ // This runs at runtime, not during build
141
+ }
142
+ }
143
+ */
144
+ }
145
+ }
146
+
147
+ /// <summary>
148
+ /// Summary of when to pack atlases:
149
+ ///
150
+ /// Editor Time (✅ DO):
151
+ /// - IPreprocessBuildWithReport.OnPreprocessBuild()
152
+ /// - Manual packing via SpriteAtlasUtility.PackAtlases() for preview
153
+ ///
154
+ /// Build Time (❌ DON'T):
155
+ /// - IPostprocessBuildWithReport.OnPostprocessBuild()
156
+ /// - Any time during actual build process
157
+ ///
158
+ /// Runtime (✅ DO):
159
+ /// - Load atlases on-demand using SpriteAtlasManager
160
+ /// - Use Addressables or AssetBundles for dynamic loading
161
+ /// </summary>
162
+ public static class PackingTimeline
163
+ {
164
+ /// <summary>
165
+ /// Editor: Prebuild - Pack atlases here ✅
166
+ /// </summary>
167
+ public static void Pack_Editor_Prebuild()
168
+ {
169
+ // IPreprocessBuildWithReport.OnPreprocessBuild()
170
+ // This is the correct time to pack atlases
171
+ }
172
+
173
+ /// <summary>
174
+ /// Build: Build process - Do NOT pack here ❌
175
+ /// </summary>
176
+ public static void Pack_Build_Process()
177
+ {
178
+ // IPostprocessBuildWithReport.OnPostprocessBuild()
179
+ // Atlases are already packed at this point
180
+ }
181
+
182
+ /// <summary>
183
+ /// Runtime: Late-binding - Load atlases on-demand ✅
184
+ /// </summary>
185
+ public static void Pack_Runtime_LateBinding()
186
+ {
187
+ // SpriteAtlasManager.atlasRegistrationNeeded
188
+ // Load atlases as needed during gameplay
189
+ }
190
+ }
@@ -0,0 +1,114 @@
1
+ // [UNITY-SKILL:SPRITEATLAS]
2
+ using UnityEngine;
3
+ using UnityEditor;
4
+ using UnityEditor.U2D;
5
+ using UnityEngine.U2D;
6
+
7
+ /// <summary>
8
+ /// Demonstrates what NOT to do when scripting SpriteAtlases in editor code.
9
+ /// This file shows common mistakes and their consequences.
10
+ /// </summary>
11
+ public static class DontScriptSpriteAtlasInEditor
12
+ {
13
+ /// <summary>
14
+ /// ❌ WRONG: Creating SpriteAtlas directly in editor code.
15
+ /// SpriteAtlas is a runtime-only type. This will fail at compile time or runtime.
16
+ /// </summary>
17
+ [System.Obsolete("This is incorrect - do not use")]
18
+ public static void Wrong_CreateSpriteAtlasDirectly()
19
+ {
20
+ // This is WRONG - SpriteAtlas cannot be constructed in editor code
21
+ // SpriteAtlas atlas = new SpriteAtlas(); // Compile error!
22
+ }
23
+
24
+ /// <summary>
25
+ /// ❌ WRONG: Using AssetDatabase.LoadAssetAtPath<SpriteAtlas>() in editor.
26
+ /// Use SpriteAtlasAsset for editor authoring, not SpriteAtlas.
27
+ /// </summary>
28
+ [System.Obsolete("This is incorrect - do not use")]
29
+ public static void Wrong_LoadSpriteAtlasInEditor()
30
+ {
31
+ // This is WRONG - SpriteAtlas is runtime-only
32
+ // SpriteAtlas atlas = AssetDatabase.LoadAssetAtPath<SpriteAtlas>("path/to/atlas.spriteatlas"); // Runtime error!
33
+ }
34
+
35
+ /// <summary>
36
+ /// ❌ WRONG: Modifying SpriteAtlas in editor scripts.
37
+ /// SpriteAtlas is read-only at runtime and cannot be created in editor.
38
+ /// </summary>
39
+ [System.Obsolete("This is incorrect - do not use")]
40
+ public static void Wrong_ModifySpriteAtlasInEditor()
41
+ {
42
+ // This is WRONG - cannot modify SpriteAtlas in editor
43
+ // atlas.Add(sprites); // Compile error!
44
+ }
45
+
46
+ /// <summary>
47
+ /// ❌ WRONG: Using deprecated SpriteAtlasAsset methods.
48
+ /// Use the two-step pattern with SpriteAtlasImporter instead.
49
+ /// </summary>
50
+ [System.Obsolete("This is incorrect - do not use")]
51
+ public static void Wrong_UseDeprecatedMethods()
52
+ {
53
+ // This is WRONG - deprecated methods should not be used
54
+ // SpriteAtlasAsset atlas = new SpriteAtlasAsset();
55
+ // atlas.SetBuildSettings(...); // Deprecated!
56
+ }
57
+
58
+ /// <summary>
59
+ /// ❌ WRONG: Modifying importer without calling SaveAndReimport().
60
+ /// Changes to SpriteAtlasImporter are not applied until you save and reimport.
61
+ /// </summary>
62
+ [System.Obsolete("This is incorrect - do not use")]
63
+ public static void Wrong_ModifyWithoutSaving()
64
+ {
65
+ // This is WRONG - changes won't be saved
66
+ // SpriteAtlasImporter importer = ...;
67
+ // importer.includeInBuild = true; // Not applied!
68
+ // No SaveAndReimport() called!
69
+ }
70
+
71
+ /// <summary>
72
+ /// ❌ WRONG: Confusing authoring vs runtime contexts.
73
+ /// SpriteAtlasAsset (editor) and SpriteAtlas (runtime) are different types.
74
+ /// </summary>
75
+ [System.Obsolete("This is incorrect - do not use")]
76
+ public static void Wrong_ConfuseAuthoringVsRuntime()
77
+ {
78
+ // This is WRONG - mixing contexts
79
+ // SpriteAtlasAsset asset = ...;
80
+ // SpriteAtlas runtime = asset; // Type mismatch!
81
+ }
82
+ }
83
+
84
+ /// <summary>
85
+ /// CORRECT: The proper way to work with SpriteAtlases in editor code.
86
+ /// </summary>
87
+ public static class CorrectEditorPattern
88
+ {
89
+ /// <summary>
90
+ /// Create and configure an atlas using the correct two-step V2 pattern.
91
+ /// </summary>
92
+ public static void CreateAndConfigureAtlas(string path, Object[] sprites)
93
+ {
94
+ // Step 1: Create with SpriteAtlasAsset (editor-only)
95
+ SpriteAtlasAsset asset = new SpriteAtlasAsset();
96
+ asset.Add(sprites);
97
+ SpriteAtlasAsset.Save(asset, path);
98
+
99
+ // Step 2: Import and configure via SpriteAtlasImporter
100
+ AssetDatabase.ImportAsset(path);
101
+
102
+ SpriteAtlasImporter importer = AssetImporter.GetAtPath(path) as SpriteAtlasImporter;
103
+ if (importer != null)
104
+ {
105
+ importer.includeInBuild = true;
106
+ var packingSettings = importer.packingSettings;
107
+ packingSettings.enableTightPacking = true;
108
+ importer.packingSettings = packingSettings;
109
+
110
+ // CRITICAL: Save and reimport to apply changes
111
+ importer.SaveAndReimport();
112
+ }
113
+ }
114
+ }
@@ -0,0 +1,95 @@
1
+ // [UNITY-SKILL:SPRITEATLAS]
2
+ using UnityEditor;
3
+ using UnityEditor.U2D;
4
+ using UnityEngine;
5
+
6
+ /// <summary>
7
+ /// Demonstrates proper editor configuration for SpriteAtlas V2.
8
+ /// Always use SpriteAtlasImporter for all settings in editor code.
9
+ /// </summary>
10
+ public static class EditorConfigurationExample
11
+ {
12
+ /// <summary>
13
+ /// Configures an existing atlas asset with proper editor settings.
14
+ /// This is the correct pattern - create with SpriteAtlasAsset, then configure via SpriteAtlasImporter.
15
+ /// </summary>
16
+ public static void ConfigureSpriteAtlas(string atlasPath)
17
+ {
18
+ // Step 1: Ensure Sprite Packer is enabled
19
+ EditorSettings.spritePackerMode = SpritePackerMode.SpriteAtlasV2;
20
+
21
+ // Step 2: Get the importer for configuration
22
+ SpriteAtlasImporter importer = AssetImporter.GetAtPath(atlasPath) as SpriteAtlasImporter;
23
+
24
+ if (importer == null)
25
+ {
26
+ Debug.LogError($"Could not get SpriteAtlasImporter for {atlasPath}");
27
+ return;
28
+ }
29
+
30
+ // Step 3: Configure texture settings via importer
31
+ var textureSettings = importer.textureSettings;
32
+ textureSettings.generateMipMaps = false;
33
+ textureSettings.filterMode = FilterMode.Bilinear;
34
+ importer.textureSettings = textureSettings;
35
+
36
+ // Step 4: Configure packing settings
37
+ var packingSettings = importer.packingSettings;
38
+ packingSettings.padding = 2;
39
+ packingSettings.enableRotation = true;
40
+ packingSettings.enableTightPacking = true;
41
+
42
+ // Step 5: Configure platform settings
43
+ var platformSettings = importer.GetPlatformSettings("DefaultTexturePlatform");;
44
+ platformSettings.maxTextureSize = 2048;
45
+ platformSettings.format = TextureImporterFormat.ASTC_6x6;
46
+ platformSettings.compressionQuality = 100;
47
+ importer.GetPlatformSettings("DefaultTexturePlatform");
48
+
49
+ // Step 6: Set build inclusion
50
+ importer.includeInBuild = true;
51
+
52
+ // Step 7: CRITICAL - Save and reimport to apply changes
53
+ importer.SaveAndReimport();
54
+
55
+ Debug.Log($"Configured atlas at {atlasPath}");
56
+ }
57
+
58
+ /// <summary>
59
+ /// Configures platform-specific settings for multiple platforms.
60
+ /// </summary>
61
+ public static void ConfigurePlatformSettings(string atlasPath)
62
+ {
63
+ SpriteAtlasImporter importer = AssetImporter.GetAtPath(atlasPath) as SpriteAtlasImporter;
64
+
65
+ // Mobile platform (Android/iOS)
66
+ importer.SetPlatformSettings(new TextureImporterPlatformSettings
67
+ {
68
+ name = "Android",
69
+ maxTextureSize = 1024,
70
+ format = TextureImporterFormat.ETC2_RGB4,
71
+ compressionQuality = 100
72
+ });
73
+
74
+ importer.SetPlatformSettings(new TextureImporterPlatformSettings
75
+ {
76
+ name = "iOS",
77
+ maxTextureSize = 1024,
78
+ format = TextureImporterFormat.ASTC_6x6,
79
+ compressionQuality = 100
80
+ });
81
+
82
+ // Desktop platform (Windows/Mac/Linux)
83
+ importer.SetPlatformSettings(new TextureImporterPlatformSettings
84
+ {
85
+ name = "Standalone",
86
+ maxTextureSize = 1024,
87
+ format = TextureImporterFormat.DXT5,
88
+ compressionQuality = 100
89
+ });
90
+
91
+
92
+ // Save and reimport
93
+ importer.SaveAndReimport();
94
+ }
95
+ }
@@ -0,0 +1,172 @@
1
+ // [UNITY-SKILL:SPRITEATLAS]
2
+ using UnityEditor;
3
+ using UnityEditor.U2D;
4
+ using UnityEngine;
5
+
6
+ /// <summary>
7
+ /// Demonstrates enabling and configuring Sprite Packer for SpriteAtlases.
8
+ /// Proper packing configuration is essential for efficient atlas usage.
9
+ /// </summary>
10
+ public static class EnableSpritePackingExample
11
+ {
12
+ /// <summary>
13
+ /// Enables Sprite Packer mode in Project Settings.
14
+ /// This must be done before creating atlases.
15
+ /// </summary>
16
+ public static void EnableSpritePacker()
17
+ {
18
+ EditorSettings.spritePackerMode = SpritePackerMode.SpriteAtlasV2;
19
+ Debug.Log("Sprite Packer V2 enabled");
20
+ }
21
+
22
+ /// <summary>
23
+ /// Configures packing settings for an atlas.
24
+ /// Tight packing reduces texture memory usage.
25
+ /// </summary>
26
+ public static void ConfigurePackingSettings(string atlasPath)
27
+ {
28
+ SpriteAtlasImporter importer = AssetImporter.GetAtPath(atlasPath) as SpriteAtlasImporter;
29
+ if (importer == null)
30
+ return;
31
+
32
+ // Enable tight packing for better space utilization
33
+ var packingSettings = importer.packingSettings;
34
+ packingSettings.enableTightPacking = true;
35
+ importer.packingSettings = packingSettings;
36
+
37
+ importer.SaveAndReimport();
38
+ }
39
+
40
+ /// <summary>
41
+ /// Configures packing settings with rotation enabled.
42
+ /// Rotation can significantly improve packing density for irregular sprites.
43
+ /// </summary>
44
+ public static void EnableRotationPacking(string atlasPath)
45
+ {
46
+ SpriteAtlasImporter importer = AssetImporter.GetAtPath(atlasPath) as SpriteAtlasImporter;
47
+ if (importer == null)
48
+ return;
49
+
50
+ var packingSettings = importer.packingSettings;
51
+ packingSettings.enableRotation = true;
52
+ importer.packingSettings = packingSettings;
53
+
54
+ importer.SaveAndReimport();
55
+ }
56
+
57
+ /// <summary>
58
+ /// Configures packing settings with padding.
59
+ /// Add padding to prevent texture bleeding between adjacent sprites.
60
+ /// </summary>
61
+ public static void ConfigurePackingWithPadding(string atlasPath, int paddingPixels)
62
+ {
63
+ SpriteAtlasImporter importer = AssetImporter.GetAtPath(atlasPath) as SpriteAtlasImporter;
64
+ if (importer == null)
65
+ return;
66
+
67
+ var packingSettings = importer.packingSettings;
68
+ packingSettings.padding = 2;
69
+ importer.packingSettings = packingSettings;
70
+
71
+ importer.SaveAndReimport();
72
+ }
73
+
74
+ /// <summary>
75
+ /// Configures packing settings for UI atlases.
76
+ /// UI sprites typically need consistent positioning without rotation.
77
+ /// </summary>
78
+ public static void ConfigureUIPacking(string atlasPath)
79
+ {
80
+ SpriteAtlasImporter importer = AssetImporter.GetAtPath(atlasPath) as SpriteAtlasImporter;
81
+ if (importer == null)
82
+ return;
83
+
84
+ // UI sprites usually shouldn't be rotated
85
+ var packingSettings = importer.packingSettings;
86
+ packingSettings.padding = 2;
87
+ packingSettings.enableTightPacking = false;
88
+ packingSettings.enableRotation = false;
89
+ packingSettings.enableAlphaDilation = false;
90
+ importer.packingSettings = packingSettings;
91
+
92
+ importer.SaveAndReimport();
93
+ }
94
+
95
+ /// <summary>
96
+ /// Configures packing settings for character/animation atlases.
97
+ /// Animation frames need consistent positioning across frames.
98
+ /// </summary>
99
+ public static void ConfigureAnimationPacking(string atlasPath)
100
+ {
101
+ SpriteAtlasImporter importer = AssetImporter.GetAtPath(atlasPath) as SpriteAtlasImporter;
102
+ if (importer == null)
103
+ return;
104
+
105
+ // UI sprites usually shouldn't be rotated
106
+ var packingSettings = importer.packingSettings;
107
+ packingSettings.padding = 2;
108
+ packingSettings.enableTightPacking = true;
109
+ packingSettings.enableRotation = false;
110
+ packingSettings.enableAlphaDilation = false;
111
+ importer.packingSettings = packingSettings;
112
+
113
+ importer.SaveAndReimport();
114
+ }
115
+ }
116
+
117
+ /// <summary>
118
+ /// Editor window for batch configuring sprite packing settings.
119
+ /// </summary>
120
+ public class ConfigurePackingWindow : EditorWindow
121
+ {
122
+ private string _atlasFolder = "Assets/Atlases";
123
+ private bool _tightPacking = true;
124
+ private bool _allowRotation = false;
125
+ private int _padding = 2;
126
+
127
+ [MenuItem("Tools/Configure Sprite Packing")]
128
+ public static void ShowWindow()
129
+ {
130
+ GetWindow<ConfigurePackingWindow>("Configure Packing");
131
+ }
132
+
133
+ private void OnGUI()
134
+ {
135
+ EditorGUILayout.LabelField("Batch Configure Packing", EditorStyles.boldLabel);
136
+
137
+ _atlasFolder = EditorGUILayout.TextField("Atlas Folder", _atlasFolder);
138
+ _tightPacking = EditorGUILayout.Toggle("Tight Packing", _tightPacking);
139
+ _allowRotation = EditorGUILayout.Toggle("Allow Rotation", _allowRotation);
140
+ _padding = EditorGUILayout.IntField("Padding (pixels)", _padding);
141
+
142
+ if (GUILayout.Button("Configure Atlases"))
143
+ {
144
+ BatchConfigure();
145
+ }
146
+ }
147
+
148
+ private void BatchConfigure()
149
+ {
150
+ string[] guids = AssetDatabase.FindAssets("t:SpriteAtlasAsset", new[] { _atlasFolder });
151
+
152
+ foreach (string guid in guids)
153
+ {
154
+ string path = AssetDatabase.GUIDToAssetPath(guid);
155
+ SpriteAtlasImporter importer = AssetImporter.GetAtPath(path) as SpriteAtlasImporter;
156
+
157
+ if (importer != null)
158
+ {
159
+ var packingSettings = importer.packingSettings;
160
+ packingSettings.padding = _padding;
161
+ packingSettings.enableTightPacking = _tightPacking;
162
+ packingSettings.enableRotation = _allowRotation;
163
+ packingSettings.enableAlphaDilation = false;
164
+ importer.packingSettings = packingSettings;
165
+ importer.SaveAndReimport();
166
+ }
167
+ }
168
+
169
+ Debug.Log($"Configured packing for {guids.Length} atlases");
170
+ AssetDatabase.Refresh();
171
+ }
172
+ }
@@ -0,0 +1,50 @@
1
+ // [UNITY-SKILL:SPRITEATLAS]
2
+ using UnityEditor.U2D;
3
+ using UnityEngine;
4
+ using Unity.Collections;
5
+
6
+ /// <summary>
7
+ /// Simple grid-based sprite packer that arranges sprites in a uniform grid pattern.
8
+ /// Sprites are placed row by row from left to right, top to bottom.
9
+ /// </summary>
10
+ public class GridSpritePacker : ScriptablePacker
11
+ {
12
+ /// <summary>Number of columns in the grid</summary>
13
+ public int columns = 4;
14
+
15
+ /// <summary>Size of each cell in pixels (assumed square)</summary>
16
+ public int cellSize = 256;
17
+
18
+ /// <summary>Padding between sprites in pixels</summary>
19
+ public int padding = 2;
20
+
21
+ /// <summary>
22
+ /// Packs sprites in a grid pattern.
23
+ /// Sprite at index i is placed at column (i % columns) and row (i / columns).
24
+ /// </summary>
25
+ public override bool Pack(SpriteAtlasPackingSettings config,
26
+ SpriteAtlasTextureSettings setting,
27
+ PackerData input)
28
+ {
29
+ NativeArray<SpriteData> sprites = input.spriteData;
30
+
31
+ for (int i = 0; i < sprites.Length; i++)
32
+ {
33
+ SpriteData sprite = sprites[i];
34
+
35
+ // Calculate grid position
36
+ int col = i % columns;
37
+ int row = i / columns;
38
+
39
+ // Set output position with padding
40
+ sprite.output.x = col * (cellSize + padding) + padding;
41
+ sprite.output.y = row * (cellSize + padding) + padding;
42
+ sprite.output.page = 0; // Single page
43
+ sprite.output.rot = PackTransform.None;
44
+
45
+ sprites[i] = sprite;
46
+ }
47
+
48
+ return true;
49
+ }
50
+ }