@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,61 @@
1
+ # Layout Components
2
+
3
+ **Layout Groups control child sizing:**
4
+ - When a parent has a Layout Group, it manages child RectTransforms
5
+ - Children's anchors and sizeDelta may be overridden by the parent
6
+ - Understand whether the parent or child controls size before setting values
7
+
8
+ **Vertical/Horizontal Layout Groups:**
9
+ - Control Child Size: determines if parent sets child dimensions
10
+ - Child Force Expand: determines if children stretch to fill space
11
+ - If Control Child Size is off, children must have explicit sizes
12
+
13
+ **Avoiding layout conflicts:**
14
+ - Do not manually set child anchors/size when parent controls them
15
+ - Do not add Layout Group to an element that should have fixed size
16
+ - Nested Layout Groups require careful configuration of each level
17
+ - When layout is wrong, check parent settings before modifying child
18
+ - ContentSizeFitter on the **same** object as a Layout Group that has Control Child Size enabled = conflict
19
+ - ContentSizeFitter on a child whose parent has Control Child Size enabled = ContentSizeFitter is overridden (wasted)
20
+ - When using ContentSizeFitter with a Layout Group parent, disable Control Child Size on the parent for the relevant axis
21
+ - Common pattern: ScrollView Content should have ContentSizeFitter + VerticalLayoutGroup where VLG controls children but ContentSizeFitter sizes the Content itself
22
+
23
+ **Grid Layout Group:**
24
+ - For inventory grids, card layouts
25
+ - Cell Size must be set explicitly — children are sized to match
26
+ - Constraint controls row/column limits
27
+
28
+ **Content Size Fitter:**
29
+ - Horizontal/Vertical Fit: Preferred Size
30
+ - Use on containers that should size to their content
31
+ - Requires a layout element or text component to provide preferred size
32
+
33
+ # RectTransform Anchoring
34
+
35
+ **Elements must have non-zero size to be visible:**
36
+ - Set explicit width/height via sizeDelta, or
37
+ - Use stretch anchors with proper offsets, or
38
+ - Let a parent Layout Group control size (with Control Child Size enabled)
39
+
40
+ **Anchor configuration order:**
41
+ 1. Set anchor preset first (corner, edge, or stretch)
42
+ 2. Then set position/offset values
43
+ 3. Verify the resulting size is non-zero
44
+
45
+ **Common patterns:**
46
+ - **Stretch anchors** — for responsive elements that fill available space
47
+ - **Corner anchors** — for fixed-position, fixed-size elements
48
+ - **Edge anchors** — for elements that stretch in one direction only
49
+
50
+ **Positioning from natural language descriptions:**
51
+ When the user describes a position (e.g., "top right", "bottom bar", "left side"):
52
+ 1. Determine if it's a **corner** (fixed point), an **edge** (stretch along one axis), or **fill** (stretch both axes)
53
+ 2. Set anchor min and anchor max — for corners these are the same point; for edges/fill they span a range
54
+ 3. **Set pivot to match the anchor point** — pivot must align with where the element is anchored, not left at the default (0.5, 0.5). A "top right" element needs pivot at the top-right corner; a "top bar" needs pivot at the top edge center
55
+ 4. Set position/offset values **after** anchors and pivot are configured
56
+
57
+ **Visibility checklist:**
58
+ - Width and height are both greater than zero
59
+ - Element is within parent bounds
60
+ - Element is not obscured by siblings (check hierarchy order)
61
+ - Image component has a sprite or color with alpha > 0
@@ -0,0 +1,29 @@
1
+ # ScrollView Setup
2
+
3
+ ScrollRect requires a specific hierarchy to function correctly. Missing or misordered components cause jitter, duplication, or non-scrollable content.
4
+
5
+ **Required hierarchy:**
6
+ ```
7
+ ScrollView (ScrollRect)
8
+ ├── Viewport (RectTransform + Mask + Image)
9
+ │ └── Content (RectTransform + VerticalLayoutGroup + ContentSizeFitter)
10
+ │ └── [Children — static or added at runtime]
11
+ └── Scrollbar (optional)
12
+ ```
13
+
14
+ **Setup rules:**
15
+ - **ScrollRect** component goes on the root ScrollView object
16
+ - **Viewport** must have a `Mask` component and an `Image` component (Mask requires Image)
17
+ - **Content** must have `ContentSizeFitter` with Vertical Fit set to "Preferred Size" so the scroll area grows with children
18
+ - ScrollRect references: assign Content to `Content`, Viewport to `Viewport`, and optionally assign a Scrollbar
19
+ - Content can contain static children (settings lists, about pages) or be populated dynamically at runtime
20
+
21
+ **Dynamic population (runtime items):**
22
+ - **Clear existing children** before populating to prevent duplication on panel re-open
23
+ - Instantiate item prefabs as children of the Content object
24
+ - The ContentSizeFitter + VerticalLayoutGroup on Content will automatically size the scrollable area
25
+
26
+ **Common failures:**
27
+ - Items duplicated on every open → Content not cleared before populating
28
+ - Content not scrollable → missing ContentSizeFitter on Content, or Viewport missing Mask
29
+ - Jitter/flickering → ContentSizeFitter conflict with parent Layout Group (see "Avoiding layout conflicts" in the main skill)
@@ -0,0 +1,229 @@
1
+ ---
2
+ name: ui-uitk
3
+ description: Understands, edits, and generates Unity UI Toolkit UXML and USS with flex layouts. Use for requests involving UI Toolkit, UIElements, UIDocument, PanelSettings, custom elements, or UI runtime binding.
4
+ ---
5
+
6
+ Understand existing Unity UI Toolkit code, make targeted edits, generate new UXML/USS files, Manipulators, and handle UI runtime binding.
7
+
8
+ ## References
9
+
10
+ Read these as needed:
11
+ - [references/uss-guide.md](references/uss-guide.md) — USS patterns and examples
12
+ - [references/svg-icons.md](references/svg-icons.md) — SVG icon generation (only when generating icons)
13
+ - [references/common-issues.md](references/common-issues.md) — Common mistakes to avoid
14
+ - [references/ui-runtime-binding.md](references/ui-runtime-binding.md) — Patterns and guide to bind data to UI at runtime (only when requested or when bindings are involved)
15
+ - [references/painter2d.md](references/painter2d.md) — Painter2D API for custom visuals: gradients, shapes, arcs, procedural drawing (read this whenever gradients, custom shapes, progress rings, procedural drawing, or any visual beyond what USS can express is needed)
16
+ - [references/pointermanipulator-guide.md](references/pointermanipulator-guide.md) — Patterns and guide to create and use Manipulators (only when requested or when manipulators are involved). This helps with setting up drag and drop features or simple event handling for a Visual Element.
17
+ - [references/custom-elements.md](references/custom-elements.md) — Custom UI Element patterns and guide to create reusable components with UXML, USS, and C#. This helps with creating complex UI components for reuse across the project.
18
+
19
+ Paths are relative to this skill's folder — read `references/uss-guide.md` directly.
20
+
21
+ ## Understanding
22
+
23
+ When explaining UI structure, use this format:
24
+ ```
25
+ [ElementType] name="elementName" class="class1 class2"
26
+ ├── [ChildType] name="childName"
27
+ │ └── [GrandchildType]
28
+ └── [ChildType] class="another-class"
29
+ ```
30
+
31
+ ## Editing
32
+
33
+ **Common edit requests:**
34
+
35
+ | Request | Action |
36
+ |---------|--------|
37
+ | "Change button color" | Edit USS selector for that button |
38
+ | "Add a label here" | Add element to UXML at specified location |
39
+ | "Make this bigger" | Edit width/height in USS |
40
+ | "Hide this element" | Add `display: none` to USS or remove from UXML |
41
+ | "Rename this element" | Update `name` attribute in UXML |
42
+
43
+ **Don't over-edit:**
44
+ - Change only what's requested
45
+ - Preserve formatting and structure
46
+ - Don't "improve" unrelated code
47
+ - Don't add comments unless asked
48
+ - For targeted changes, prefer modifying specific elements or selectors over rewriting entire files — but use judgment; if a change touches most of the file, a rewrite may be cleaner
49
+ - Be careful not to accidentally drop existing elements, styles, or references when making edits
50
+ - **When editing USS**, focus on the properties and selectors relevant to the request — avoid unnecessary reorganization, but restructure if the change genuinely requires it
51
+
52
+ ## Validation
53
+
54
+ There is no way to validate UXML or USS from outside the Editor — Unity parses these
55
+ files on import and reports problems in the Console. Write the files, then have the
56
+ user check the result.
57
+
58
+ **Workflow:**
59
+
60
+ 1. Write the complete file to its target path in the project. Do not write partial or
61
+ draft content — a half-written UXML file is a parse error the moment the Editor
62
+ picks it up.
63
+ 2. Ask the user to focus the Unity Editor. That triggers a reimport of the changed
64
+ assets.
65
+ 3. Ask them to report anything in the Console. UXML parse errors name the file and
66
+ line; USS problems appear as warnings about unknown properties or selectors.
67
+ 4. Fix what they report and repeat from step 1.
68
+
69
+ **Because feedback costs a user round-trip, get it right the first time:**
70
+
71
+ - Finish all files before asking the user to check, so one reimport covers everything
72
+ rather than one per file.
73
+ - Re-read `references/uss-guide.md` and `references/common-issues.md` before writing,
74
+ rather than after an error comes back.
75
+ - Watch for the mistakes that survive a parse but render wrong — those will not appear
76
+ in the Console at all, so the user has to eyeball the UI. `references/common-issues.md`
77
+ lists them.
78
+
79
+ ## Generation
80
+
81
+ When creating new UI:
82
+
83
+ **Generate only what is requested:**
84
+
85
+ | Request | Output |
86
+ |---------|--------|
87
+ | USS only | `.uss` file only |
88
+ | UXML only | `.uxml` file only |
89
+ | UI screen / menu / panel | `.uss` + `.uxml` only |
90
+ | "with code" / "with logic" / "functional" | `.uss` + `.uxml` + `.cs` |
91
+
92
+ **These do NOT imply C#:**
93
+ - "proper buttons" → well-styled Button elements
94
+ - "currency display" → a Label element
95
+ - "working UI" → valid UXML/USS that renders
96
+ - "inventory screen" → visual layout only
97
+ - "inventory system" / "equipment system" / "crafting system" → Ask: "Should items be draggable?" If yes, see `references/pointermanipulator-guide.md` for patterns
98
+
99
+ **Generation workflow:**
100
+ 1. **Analyze** — Determine exactly what files are needed. No extras.
101
+ 2. **Search** — Find existing USS, UXML, assets. Don't assume paths.
102
+ 3. **Follow project patterns** — Match folder structure and naming conventions.
103
+ 4. **Reuse** — Check for shared stylesheets. Reuse if appropriate.
104
+ 5. **Write USS first** — Verify against restrictions below.
105
+ 6. **Write UXML** — Reference the USS, verify structure.
106
+ 7. **Write the files out complete** — never partial content; see Validation above for
107
+ how errors come back and why one round of files beats several.
108
+ 8. **Scene setup** — Assign PanelSettings if adding UI to scene.
109
+ 9. **Data binding** — If requested, add C# script with runtime data binding patterns (see `references/ui-runtime-binding.md`). Generate the scriptable object asset if needed. Assign the asset to the UI element root in UXML or via datasource in C#.
110
+
111
+ **Color, visibility, and specification rules:**
112
+ - **Ensure text is readable by default:** When choosing colors, ensure text contrasts with its background — but respect intentional low-contrast uses (disabled states, placeholder text, decorative elements). When using design tokens, check that text and background variables provide adequate contrast.
113
+ - **Honor exact values:** User-specified hex colors, pixel dimensions, spacing — use exactly as given. Do not approximate or substitute.
114
+
115
+ **Styling / Theme**
116
+ When styling UI or adjusting theme make sure to not only apply to the elements directly in the current UXML but also to the core elements of UI Toolkit which are composed of several child elements usually.
117
+
118
+ ## Conventions
119
+
120
+ **Follow project patterns first.** Search existing files before applying defaults.
121
+
122
+ | Type | Convention | Good | Bad |
123
+ |------|------------|------|-----|
124
+ | `name` attribute | camelCase | `submitButton` | `submit-button` |
125
+ | `class` attribute / USS | kebab-case | `.submit-button` | `.submitButton` |
126
+ | File paths | Feature folders | `Assets/UI/Inventory/` | `Assets/Scripts/UI/` |
127
+
128
+ **Output format:**
129
+ ```uxml Filename.uxml
130
+ <ui:UXML>...</ui:UXML>
131
+ ```
132
+ ```uss Filename.uss
133
+ .class { ... }
134
+ ```
135
+
136
+ ## USS Restrictions
137
+
138
+ Unity's USS is a subset of CSS. These properties do NOT exist — NEVER use them:
139
+
140
+ | NEVER Use | Use Instead |
141
+ |-----------|-------------|
142
+ | `border` shorthand | `border-width`, `border-color` separately |
143
+ | `gap` | `margin` on children |
144
+ | `z-index` | DOM order or parent nesting |
145
+ | `pointer-events` | `picking-mode` UXML attribute |
146
+ | `filter` | Not supported |
147
+ | `outline` | `border-*` properties |
148
+ | `box-shadow` | Nested elements or background image |
149
+ | `:first-child`, `:last-child`, `:nth-child` | Explicit classes |
150
+ | `[attribute]` selectors | Explicit classes |
151
+ | `transition-property: <value>` | Omit entirely, or `none`/`initial`/`inherit` only |
152
+ | `linear-gradient()`, `radial-gradient()` | Custom `VisualElement` with Painter2D (see `references/painter2d.md`) |
153
+
154
+ **Inline styles:** NEVER use `style="..."` in UXML. All styling in USS only.
155
+
156
+ **External URLs:** NEVER use `url()` with external paths. Only `url("project://database/Assets/...")`.
157
+
158
+ **Prefer flexible layouts over hardcoded sizes:**
159
+ - Use `flex-grow`, `flex-shrink`, or `%` instead of fixed `width`/`height` values
160
+ - Let elements flow naturally and be constrained by their parent container
161
+ - Set explicit pixel sizes only on root containers or when a fixed size is truly required
162
+ - Child elements should adapt to available space rather than define their own dimensions
163
+
164
+ ## USS Brevity
165
+
166
+ - No default values (`flex-direction: column` is default)
167
+ - No default fonts
168
+ - No redundant constraints (`width: 100px` doesn't need `min-width`/`max-width`)
169
+ - No overlapping properties (`flex: 1` already sets grow/shrink)
170
+ - Simplest selector that works
171
+ - Never duplicate selectors
172
+
173
+ ## UXML
174
+
175
+ Every file must:
176
+ 1. Declare namespace: `<ui:UXML xmlns:ui="UnityEngine.UIElements">`
177
+ 2. Link stylesheet(s): `<ui:Style src="Screen.uss" />`
178
+ 3. Have exactly one top-level container
179
+ 4. **No `style="..."` attributes** — use USS only
180
+
181
+ ```uxml
182
+ <ui:UXML xmlns:ui="UnityEngine.UIElements">
183
+ <ui:Style src="Panel.uss" />
184
+ <ui:VisualElement name="root" class="panel">
185
+ <!-- content -->
186
+ </ui:VisualElement>
187
+ </ui:UXML>
188
+ ```
189
+
190
+ ## Events and Interactivity
191
+ - Use Pointer Manipulators for event handling and interactivity on a VisualElement (see `references/pointermanipulator-guide.md`)
192
+ - If drag and drop is requested then write a pointer Manipulator and attach it to the relevant Visual Element in UXML or via C#.
193
+ - For simple click events, you can use the `clickable` manipulator in UXML
194
+ - For more advanced interactions, create use more traditional event callbacks in C# and attach them to elements as needed
195
+
196
+ **For inventory and crafting systems:**
197
+ - When users request an "inventory system", "equipment system", or "crafting system", ask explicitly: "Should players be able to drag and drop items?"
198
+ - If yes, read `references/pointermanipulator-guide.md` for inventory/crafting-specific patterns
199
+ - If no or unclear, create static layout only
200
+
201
+ ## Assets
202
+
203
+ **Do NOT reference `UnityDefaultRuntimeTheme.tss`** or Unity's built-in theme icons.
204
+
205
+ **Icon priority:**
206
+ 1. Reuse existing project icons
207
+ 2. Generate SVG (see `references/svg-icons.md`)
208
+ 3. Image generators (last resort)
209
+
210
+ **Reference format:**
211
+ ```uss
212
+ background-image: url("project://database/Assets/UI/Textures/icon.png");
213
+ ```
214
+
215
+ ## Scene Setup
216
+
217
+ **PanelSettings is required** — UI won't render without it.
218
+
219
+ 1. Search for existing PanelSettings asset
220
+ 2. If none, create generic: `Assets/UI/PanelSettings.asset`
221
+ 3. Assign to UIDocument's `Panel Settings` field
222
+
223
+ Skip for Editor UI (EditorWindow, PropertyDrawer).
224
+
225
+ ## C# (Only When Requested)
226
+
227
+ - Style via USS classes (`AddToClassList()`) — never use `element.style.*` as inline styles have higher specificity than USS selectors, making them impossible to override via stylesheets, and add per-element memory overhead
228
+ - UITK uses TextCore text assets — use `FontAsset`, `TextStyleSheet`, and `TextSettings`, not their TextMeshPro equivalents (`TMP_FontAsset`, etc.)
229
+ - Place scripts in same folder as UXML/USS
@@ -0,0 +1,74 @@
1
+ # Common USS/UXML Issues
2
+
3
+ ## Transitions on :hover
4
+
5
+ Transitions must be defined on the base class, not the hover state:
6
+
7
+ ```uss
8
+ /* WRONG - won't animate on hover-out */
9
+ .button:hover {
10
+ background-color: blue;
11
+ transition-duration: 0.2s;
12
+ }
13
+
14
+ /* CORRECT */
15
+ .button {
16
+ background-color: white;
17
+ transition-duration: 0.2s;
18
+ }
19
+ .button:hover {
20
+ background-color: blue;
21
+ }
22
+ ```
23
+
24
+ ## Hardcoded Percentage Widths
25
+
26
+ Avoid hardcoded percentages for flexible layouts:
27
+
28
+ ```uss
29
+ /* AVOID */
30
+ .column {
31
+ width: 33%;
32
+ }
33
+
34
+ /* PREFER */
35
+ .column {
36
+ flex-grow: 1;
37
+ }
38
+ ```
39
+
40
+ ## Unclosed Brackets
41
+
42
+ Always ensure brackets are properly closed:
43
+
44
+ ```uss
45
+ /* WRONG - missing closing bracket */
46
+ .panel {
47
+ padding: 16px;
48
+
49
+ .button {
50
+ color: white;
51
+ }
52
+
53
+ /* CORRECT */
54
+ .panel {
55
+ padding: 16px;
56
+ }
57
+
58
+ .button {
59
+ color: white;
60
+ }
61
+ ```
62
+
63
+ ## Referencing Unity Theme
64
+
65
+ **Do NOT reference `UnityDefaultRuntimeTheme.tss`** or built-in theme icons.
66
+
67
+ Create custom styles or reuse project assets instead.
68
+
69
+ ## Performance Issues
70
+
71
+ - **Inline styles** cause per-element memory overhead
72
+ - **`:hover` on parents** with many children invalidates entire hierarchies
73
+ - **Many classes per element** decreases selector performance linearly
74
+ - **Large hierarchies** are the main performance factor
@@ -0,0 +1,241 @@
1
+ # Custom VisualElements in UI Toolkit
2
+
3
+ Guide for creating custom VisualElements using Unity 6+ `[UxmlElement]` and `[UxmlAttribute]` attributes.
4
+
5
+ ## Table of Contents
6
+
7
+ - [Overview](#overview)
8
+ - [Requirements](#requirements)
9
+ - [Supported Property Types](#supported-property-types)
10
+ - [Advanced Patterns](#advanced-patterns)
11
+ - [Best Practices](#best-practices)
12
+ - [UXML Namespace Declaration](#uxml-namespace-declaration)
13
+ - [UI Builder Integration](#ui-builder-integration)
14
+ - [Summary](#summary)
15
+
16
+ ## Overview
17
+
18
+ Unity 6+ uses attribute-based custom elements. The old factory pattern (`IUxmlFactory`, `UxmlTraits`) is **deprecated**.
19
+
20
+ ### ⚠ CRITICAL: Namespace Declaration
21
+
22
+ **Never include assembly names in UXML namespace declarations:**
23
+
24
+ ```xml
25
+ ❌ WRONG: xmlns:custom="Game.UI.Custom, Assembly-CSharp"
26
+ ✅ CORRECT: xmlns:custom="Game.UI.Custom"
27
+ ```
28
+
29
+ **Format**: `xmlns:prefix="Namespace.Path"` (namespace only, no assembly)
30
+
31
+ ### Basic Pattern
32
+
33
+ ```csharp
34
+ [UxmlElement]
35
+ public partial class MyElement : VisualElement
36
+ {
37
+ [UxmlAttribute]
38
+ public string myValue { get; set; }
39
+ }
40
+ ```
41
+
42
+ ```xml
43
+ <ui:UXML xmlns:ui="UnityEngine.UIElements"
44
+ xmlns:custom="Game.UI.Custom">
45
+ <custom:MyElement my-value="Hello" />
46
+ </ui:UXML>
47
+ ```
48
+
49
+ ## Requirements
50
+
51
+ 1. **[UxmlElement]** attribute on the class
52
+ 2. **partial** keyword required
53
+ 3. Inherit from **VisualElement** or subclass
54
+ 4. **[UxmlAttribute]** on exposed properties
55
+
56
+ ### Property Naming
57
+
58
+ C# camelCase → UXML kebab-case:
59
+ - `myStringValue` → `my-string-value`
60
+ - `maxHealth` → `max-health`
61
+
62
+ ### Example
63
+
64
+ ```csharp
65
+ [UxmlElement]
66
+ public partial class CustomLabel : Label
67
+ {
68
+ [UxmlAttribute]
69
+ public Color textColor { get; set; } = Color.white;
70
+
71
+ [UxmlAttribute]
72
+ public int fontSize { get; set; } = 14;
73
+
74
+ public CustomLabel()
75
+ {
76
+ RegisterCallback<GeometryChangedEvent>(evt => {
77
+ style.color = textColor;
78
+ style.fontSize = fontSize;
79
+ });
80
+ }
81
+ }
82
+ ```
83
+
84
+ ```xml
85
+ <custom:CustomLabel text="Hello" text-color="rgb(255,215,0)" font-size="24" />
86
+ ```
87
+
88
+ ## Supported Property Types
89
+
90
+ **Basic**: `string`, `int`, `float`, `bool`, `Color`
91
+ **Unity**: `Texture2D`, `Sprite`, `Font`
92
+ **Enums**: Any enum type
93
+ **Collections**: `List<T>`, `T[]`
94
+
95
+ ### Image Handling
96
+
97
+ **Static images** (don't change) → Use USS:
98
+ ```css
99
+ .icon { background-image: url('project://Assets/UI/Icons/fireball.png'); }
100
+ ```
101
+
102
+ **Dynamic images** (change per instance) → Use `[UxmlAttribute]`:
103
+ ```csharp
104
+ [UxmlAttribute]
105
+ public Sprite portrait { get; set; } // Different per character
106
+ ```
107
+
108
+ ## Advanced Patterns
109
+
110
+ ### Validation Attributes
111
+
112
+ ```csharp
113
+ [UxmlAttribute]
114
+ [Range(0, 100)]
115
+ [Tooltip("Current health value")]
116
+ public float health { get; set; } = 100f;
117
+ ```
118
+
119
+ Improves UI Builder inspector experience.
120
+
121
+ ### Custom Attribute Names
122
+
123
+ ```csharp
124
+ [UxmlAttribute("hp")]
125
+ public float health { get; set; } // Use "hp" in UXML
126
+ ```
127
+
128
+ ### Custom Type Converters
129
+
130
+ Use `UxmlAttributeConverter<T>` when a property's type is not natively supported by UXML (e.g. structs, complex data objects). An example below implements `FromString` to parse the UXML attribute string into the specified type, then register it with `[UxmlAttributeConverter]` on the property.
131
+
132
+ ```csharp
133
+ public class HealthDataConverter : UxmlAttributeConverter<HealthData>
134
+ {
135
+ public override HealthData FromString(string value)
136
+ {
137
+ var parts = value.Split(',');
138
+ return new HealthData { current = float.Parse(parts[0]), max = float.Parse(parts[1]) };
139
+ }
140
+ }
141
+
142
+ [UxmlAttribute]
143
+ [UxmlAttributeConverter(typeof(HealthDataConverter))]
144
+ public HealthData healthData { get; set; }
145
+ ```
146
+
147
+ ### Custom Property Drawers
148
+
149
+ Create custom UI Builder inspector controls for your attributes:
150
+
151
+ ```csharp
152
+ // 1. Custom attribute
153
+ public class SliderDrawerAttribute : PropertyAttribute { }
154
+
155
+ // 2. Property drawer
156
+ [CustomPropertyDrawer(typeof(SliderDrawerAttribute))]
157
+ public class SliderDrawerPropertyDrawer : PropertyDrawer
158
+ {
159
+ public override VisualElement CreatePropertyGUI(SerializedProperty property)
160
+ {
161
+ var field = new SliderInt(0, 100) { label = property.displayName };
162
+ field.BindProperty(property);
163
+ return field;
164
+ }
165
+ }
166
+
167
+ // 3. Usage
168
+ [UxmlElement]
169
+ public partial class StyledButton : Button
170
+ {
171
+ [UxmlAttribute]
172
+ [SliderDrawer]
173
+ public int intensity { get; set; } = 50;
174
+ }
175
+ ```
176
+
177
+ **Override existing properties** with custom drawers:
178
+
179
+ ```csharp
180
+ [UxmlElement]
181
+ public partial class CustomIntField : IntegerField
182
+ {
183
+ // Override base 'value' property to use slider drawer in UI Builder
184
+ [UxmlAttribute("value"), SliderDrawer]
185
+ internal int myValue
186
+ {
187
+ get => this.value;
188
+ set => this.value = value;
189
+ }
190
+ }
191
+ ```
192
+
193
+ This customizes how properties appear in the UI Builder inspector.
194
+
195
+
196
+ ## Best Practices
197
+
198
+ 1. **Always use `partial`** - Required for [UxmlElement]
199
+ 2. **Provide defaults** - `public float radius { get; set; } = 30f;`
200
+ 3. **Update on changes** - Use property setters to call `UpdateVisuals()` or `MarkDirtyRepaint()`
201
+ 4. **Use backing fields** - When validation or change detection needed
202
+ 5. **USS for styling** - Add class names and style via USS, not inline styles
203
+ 6. **Static images → USS, Dynamic → C#** - Use USS `background-image` for fixed images
204
+ 7. **Document elements** - Add XML comments for better developer experience
205
+
206
+ ## UXML Namespace Declaration
207
+
208
+ ### Rules
209
+
210
+ 1. **Namespace only** - No assembly name, no commas
211
+ 2. **Exact match** - Must match C# namespace exactly (case-sensitive)
212
+ 3. **Format**: `xmlns:prefix="Namespace.Path"`
213
+
214
+ ### Examples
215
+
216
+ ```xml
217
+ <!-- ✅ Single namespace -->
218
+ <ui:UXML xmlns:ui="UnityEngine.UIElements"
219
+ xmlns:custom="Game.UI.Custom">
220
+ <custom:RadialProgress />
221
+ </ui:UXML>
222
+
223
+ <!-- ✅ Multiple namespaces -->
224
+ <ui:UXML xmlns:ui="UnityEngine.UIElements"
225
+ xmlns:hud="Game.UI.HUD"
226
+ xmlns:menu="Game.UI.Menu">
227
+ <hud:HealthBar />
228
+ <menu:SettingsPanel />
229
+ </ui:UXML>
230
+ ```
231
+
232
+ ### Common Mistakes
233
+
234
+ ```xml
235
+ ❌ xmlns:custom="Game.UI.Custom, Assembly-CSharp" (assembly name)
236
+ ❌ xmlns:custom="game.ui.custom" (wrong case)
237
+ ❌ xmlns:custom="Custom" (incomplete)
238
+ ❌ xmlns:custom="Game.UI.Custom.RadialProgress" (class name)
239
+
240
+ ✅ xmlns:custom="Game.UI.Custom" (correct)
241
+ ```