@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,191 @@
1
+ # From authored graph to runtime, and back
2
+
3
+ Graph Toolkit has no runtime. The pattern used by every official sample is: a `ScriptedImporter`
4
+ registered on the graph's extension compiles the authored graph into a plain runtime asset at import
5
+ time, the game loads that asset, and, optionally, editor-only code mirrors execution back into the
6
+ open graph window through the GraphVisualization API.
7
+
8
+ ## Contents
9
+
10
+ 1. Assembly layout
11
+ 2. The importer
12
+ 3. Walking nodes and ports
13
+ 4. Runtime data model
14
+ 5. GraphVisualization: live debug view (6.6+)
15
+ 6. Building graphs from code
16
+
17
+ ## 1. Assembly layout
18
+
19
+ - `Editor/` (or an Editor-only asmdef): graph, nodes, importer, toolbar, views. Graph Toolkit is an
20
+ Editor module, so its assemblies are available to editor code like `UnityEditor` itself: neither a
21
+ plain `Editor` folder nor an Editor-only asmdef needs a reference entry for it. The official
22
+ samples' editor asmdefs use `IPort` and `PortCapacity` with an empty `references` list.
23
+ - `Runtime/` asmdef: the runtime data model and executor. Must not reference
24
+ `Unity.GraphToolkit.Editor`. Visualization calls live here under `#if UNITY_EDITOR`, because they
25
+ need the editor to be running the game.
26
+ - If the runtime asset type is referenced from the importer, the Editor asmdef references the Runtime
27
+ asmdef, never the reverse.
28
+
29
+ ## 2. The importer
30
+
31
+ ```csharp
32
+ using Unity.GraphToolkit.Editor;
33
+ using UnityEditor.AssetImporters;
34
+
35
+ [ScriptedImporter(1, DialogueGraph.AssetExtension)] // bump the version to force reimport
36
+ class DialogueGraphImporter : ScriptedImporter
37
+ {
38
+ public override void OnImportAsset(AssetImportContext ctx)
39
+ {
40
+ var graph = GraphDatabase.LoadGraphForImporter<DialogueGraph>(ctx.assetPath);
41
+ if (graph == null)
42
+ {
43
+ Debug.LogError($"Failed to load dialogue graph: {ctx.assetPath}");
44
+ return;
45
+ }
46
+
47
+ var runtime = ScriptableObject.CreateInstance<DialogueRuntimeGraph>();
48
+ runtime.GraphId = graph.ID;
49
+ Build(graph, runtime);
50
+
51
+ ctx.AddObjectToAsset("Runtime", runtime);
52
+ ctx.SetMainObject(runtime); // the .ext file now behaves as a DialogueRuntimeGraph in inspectors
53
+ }
54
+ }
55
+ ```
56
+
57
+ - Use `LoadGraphForImporter`, not `LoadGraph`, inside importers. The state machine equivalent is
58
+ `StateMachineDatabase.LoadStateMachineForImporter<T>`.
59
+ - A null graph means the path, type or file is wrong; log and return.
60
+ - Validation errors belong in `OnGraphChanged`, which already shows markers; the importer only needs
61
+ to bail out quietly when the graph is invalid.
62
+ - Re-import happens on save. Sub-assets the game needs (textures, meshes) are added with further
63
+ `AddObjectToAsset` calls.
64
+
65
+ | Symptom | Cause | Fix |
66
+ |---|---|---|
67
+ | The asset shows as a generic Graph Toolkit asset instead of the runtime type | `ctx.SetMainObject(runtime)` missing | Call `SetMainObject` after `AddObjectToAsset` |
68
+ | Importer changes have no effect on existing assets | Import results are cached per importer version | Bump the `ScriptedImporter` version number, or reimport |
69
+ | The importer throws on an empty graph | No entry node to start from | Return early when the entry node is missing; `OnGraphChanged` already reports it |
70
+ | Edits made from code vanish, or the import sees stale data | `LoadGraph` used inside the importer | `LoadGraphForImporter` in importers, `LoadGraph` everywhere else |
71
+
72
+ ## 3. Walking nodes and ports
73
+
74
+ ```csharp
75
+ static INode Next(INode node, string outputPortName)
76
+ {
77
+ var port = node.GetOutputPortByName(outputPortName);
78
+ return port?.FirstConnectedPort?.GetNode(); // null when unconnected
79
+ }
80
+
81
+ static T ValueOf<T>(INode node, string inputPortName)
82
+ {
83
+ var port = node.GetInputPortByName(inputPortName);
84
+ if (port.IsConnected)
85
+ {
86
+ var source = port.FirstConnectedPort.GetNode(); // resolve upstream: constant node, variable node, or your node
87
+ if (source is IConstantNode constant && constant.TryGetValue<T>(out var c)) return c;
88
+ if (source is IVariableNode variable && variable.Variable.TryGetDefaultValue<T>(out var d)) return d;
89
+ }
90
+ port.TryGetValue<T>(out var embedded); // the value typed on the node
91
+ return embedded;
92
+ }
93
+ ```
94
+
95
+ - Start from a dedicated entry node type: `graph.GetNodes().OfType<StartNode>().FirstOrDefault()`.
96
+ - Ports with `PortCapacity.Multi` need `GetConnectedPorts(list)` rather than `FirstConnectedPort`.
97
+ - Record `node.ID`, `port.ID` and wire endpoints (`outputPort.ID`, `inputPort.ID`) in the runtime
98
+ asset when a debug view is planned; the visualization API is keyed by these `Hash128` values.
99
+ - Block nodes: iterate `contextNode.BlockNodes`; a block's `Index` is its order.
100
+ - Subgraph nodes: `((ISubgraphNode)node).GetSubgraph()` returns the nested `Graph`; recurse.
101
+
102
+ ## 4. Runtime data model
103
+
104
+ Keep it minimal and Unity-serializable: a `ScriptableObject` with a list of `[Serializable]` node
105
+ records or `[SerializeReference]` polymorphic nodes, referencing each other by index or `Hash128`.
106
+ Store only what execution needs; positions, titles and colors stay in the authoring asset. The
107
+ Visual Novel Director sample is the reference layout: `Runtime/` asmdef with the data model and a
108
+ `MonoBehaviour` executor that walks the records.
109
+
110
+ ## 5. GraphVisualization: live debug view (6.6+)
111
+
112
+ The manual covers contexts, node progress, port values, errors and wires from `6000.7`, on the Debug
113
+ graph view pages; the API is the same on 6.6. What it leaves out is the wiring from runtime code:
114
+
115
+ ```csharp
116
+ #if UNITY_EDITOR
117
+ using Unity.GraphToolkit.Editor.GraphVisualization;
118
+ #endif
119
+
120
+ class DialogueRunner : MonoBehaviour
121
+ {
122
+ #if UNITY_EDITOR
123
+ Context m_Debug;
124
+ #endif
125
+
126
+ void OnEnable()
127
+ {
128
+ #if UNITY_EDITOR
129
+ m_Debug = Registry.CreateVisualizationContext(runtimeGraph.GraphId); // the authored Graph.ID
130
+ #endif
131
+ }
132
+
133
+ void OnDisable()
134
+ {
135
+ #if UNITY_EDITOR
136
+ m_Debug?.Dispose();
137
+ #endif
138
+ }
139
+
140
+ void Enter(DialogueRuntimeNode node)
141
+ {
142
+ #if UNITY_EDITOR
143
+ if (m_Debug is { IsValid: true, IsGraphLoaded: true })
144
+ m_Debug.Motion.Play(m_Debug.GetNodeReference(node.Id), 1f);
145
+ #endif
146
+ }
147
+ }
148
+ ```
149
+
150
+ - Every visualization call is keyed by authored `Hash128` IDs, so the importer copies `Graph.ID`,
151
+ `node.ID` and the port IDs into the runtime asset (section 3).
152
+ - Use one context per run: create it when the run starts and dispose it when the run ends. Call the
153
+ port reference's `ClearPreview()` when the flow leaves a node, or `ClearAllVisualization()` on the
154
+ context at run end, so previews do not pile up.
155
+ - Add a `[GraphToolbarElement]` toggle that flips the context's `NodeCustomizationEnabled`,
156
+ `WireCustomizationEnabled` and `PortPreviewEnabled` (plus the `State`, `Transition` and `Condition`
157
+ ones on 6.7) so the debug view can be switched off.
158
+
159
+ | Symptom | Cause | Fix |
160
+ |---|---|---|
161
+ | Nothing shows on the graph | The context was created with the runtime asset's own ID instead of the authored `Graph.ID`, or the Graph window is not open (`IsGraphLoaded` is false) | Store `Graph.ID` in the runtime asset at import time and pass it to `CreateVisualizationContext` |
162
+ | Visualization code breaks the player build | `GraphVisualization` is editor-only | Wrap the `using` and every call in `#if UNITY_EDITOR` |
163
+
164
+ ## 6. Building graphs from code
165
+
166
+ Generators, migrations and tests build assets without the UI:
167
+
168
+ ```csharp
169
+ var graph = GraphDatabase.LoadGraph<DungeonGraph>(path) ?? GraphDatabase.CreateGraph<DungeonGraph>(path);
170
+ graph.UndoBeginRecordGraph("Generate dungeon");
171
+
172
+ var start = new StartNode { Position = new Vector2(0, 0) };
173
+ graph.AddNode(start);
174
+ start.GetInputPortByName("Prefab").TrySetValue(startRoomPrefab);
175
+
176
+ var room = new EncounterNode { Position = new Vector2(300, 0) };
177
+ graph.AddNode(room);
178
+ graph.Connect(start.GetOutputPortByName("Output"), room.GetInputPortByName("Input"));
179
+
180
+ var enemies = graph.CreateVariable<GameObject>("Enemy");
181
+ var enemyNode = graph.AddVariableNode(enemies, new Vector2(300, 150));
182
+ graph.Connect(enemyNode.GetOutputPort(0), room.GetInputPortByName("Enemy"));
183
+
184
+ GraphDatabase.SaveGraph(graph);
185
+ graph.UndoEndRecordGraph();
186
+ ```
187
+
188
+ Ports exist as soon as the node is added to the graph, because adding triggers `OnDefinePorts`.
189
+ Set `Position` before or after adding; both work. State machines follow the same shape with
190
+ `AddState`, `Connect(fromState, toState)`, `SaveStateMachine` and the `UndoBeginRecordStateMachine`
191
+ pair.
@@ -0,0 +1,270 @@
1
+ # State Machine API reference (Unity 6.7 and newer)
2
+
3
+ All types live in `Unity.GraphToolkit.Editor`. None of this exists on Unity 6000.6 or older. There is
4
+ no manual walkthrough yet: this file covers the patterns, and the Script Reference has the members.
5
+ Page names such as `statemachine.md` are under
6
+ `https://docs.unity.com/en-us/engine/<VERSION>/script-reference/unity/graphtoolkit/editor/`, with
7
+ `<VERSION>` at least `6000.7`.
8
+
9
+ ## Contents
10
+
11
+ 1. Concepts
12
+ 2. StateMachine class and asset lifecycle
13
+ 3. States
14
+ 4. Transitions and rules
15
+ 5. Conditions
16
+ 6. Custom self transitions
17
+ 7. Variables
18
+ 8. Validation with OnStateMachineChanged
19
+ 9. Context menus
20
+ 10. Custom UI for states and conditions
21
+ 11. Subgraph states
22
+ 12. Reading a state machine for a runtime
23
+
24
+ ## 1. Concepts
25
+
26
+ - A `StateMachine` is a graph whose nodes are `State`s and whose wires are transitions. The state
27
+ machine owns transitions; states have no ports to define.
28
+ - A transition connects a `FromState` to a `ToState`. A **self transition** has the same state on both
29
+ ends and is anchored on it.
30
+ - A transition carries one or more **rules** (`ITransitionRule`). The transition is taken when the
31
+ conditions of any enabled rule hold. Each rule has a `RootCondition`, an `IGroupCondition` combining
32
+ child conditions with And/Or.
33
+ - Conditions are either built in (group, variable comparison) or user types derived from
34
+ `Condition<T>` / `Condition`.
35
+ - Everything about which state is active, when transitions fire, and what a condition means at
36
+ runtime is the user's code. Graph Toolkit stores the authoring data only.
37
+
38
+ ## 2. StateMachine class and asset lifecycle
39
+
40
+ ```csharp
41
+ [StateMachine(AssetExtension)] // optional second arg: StateMachineOptions flags
42
+ [Serializable]
43
+ class EnemyBrain : StateMachine
44
+ {
45
+ public const string AssetExtension = "enemybrain";
46
+
47
+ [MenuItem("Assets/Create/AI/Enemy Brain")]
48
+ static void Create() => StateMachineDatabase.PromptInProjectBrowserToCreateNewAsset<EnemyBrain>();
49
+ }
50
+ ```
51
+
52
+ `StateMachineOptions` flags: `SupportsSubgraphs`,
53
+ `DisableAutoInclusionOfStatesFromStateMachineAssembly`. `Default` and `None` are 0. The flag applies
54
+ to states, conditions and self transitions alike.
55
+
56
+ Members of `StateMachine` and `StateMachineDatabase` are in the Script Reference (`statemachine.md`,
57
+ `statemachinedatabase.md`). Behavior the reference does not spell out:
58
+
59
+ - `Connect(from, to)` creates a new transition with one empty rule on every call, so calling it twice
60
+ on the same pair gives two transitions. Add rules to an existing transition instead of reconnecting.
61
+ `Connect(s, s)` adds a rule to the state's self transition when it already has one.
62
+ - Use `LoadStateMachineForImporter<T>` in importers, `LoadStateMachine<T>` everywhere else, and call
63
+ `SaveStateMachine` after edits from code.
64
+ - Bracket edits in `UndoBeginRecordStateMachine` / `UndoEndRecordStateMachine`, passing the
65
+ conditions you edit to the first call.
66
+
67
+ Mutating in `OnEnable`, `OnDisable` or `OnStateMachineChanged` throws `InvalidOperationException`.
68
+
69
+ ## 3. States
70
+
71
+ ```csharp
72
+ [Serializable]
73
+ [State("Movement", "Icons/Patrol.png", "Patrol")] // args after the first are optional
74
+ class PatrolState : State
75
+ {
76
+ protected override void OnDefineOptions(IOptionDefinitionContext context)
77
+ {
78
+ context.AddOption<float>("Speed").WithDefaultValue(2f).WithTooltip("Units per second");
79
+ context.AddOption<string>("Notes").AsTextArea();
80
+ }
81
+ }
82
+ ```
83
+
84
+ `StateAttribute(categoryPath[, iconPath[, title[, stylesheet]]])` mirrors `NodeAttribute`.
85
+
86
+ State options appear only in the Graph Inspector, never on the state itself.
87
+ `State.IOptionDefinitionContext`: `AddOption<T>(name)`, `AddOption(name, Type)`. Builder
88
+ `IStateOptionBuilder`: `WithDisplayName`, `WithTooltip`, `WithDefaultValue`, `Delayed`, `AsTextArea`,
89
+ `Build()`. Read back with `GetOptionByName(name).TryGetValue<T>(out v)`; `IStateOption` also has
90
+ `DataType`, `Name`, `DisplayName`, `Tooltip`, `TrySetValue<T>`.
91
+
92
+ `State` / `IState` members: `StateMachine`, `Hash128 ID`, `Title`, `Subtitle`, `Tooltip`,
93
+ `Color DefaultColor`, `float FillAmount`, `Vector2 Position`, `bool IsConnected`,
94
+ `GetIncomingTransitions()`, `GetOutgoingTransitions()`, `Options`, `OptionCount`, `GetOption(int)`,
95
+ `GetOptionByName(string)`, `RemoveFromStateMachine()`. `OnEnable()` and `OnDisable()` are on the
96
+ `State` class only, not on `IState`.
97
+
98
+ Discovery: states in the state machine's assembly are listed automatically; elsewhere use
99
+ `[UseWithStateMachine(typeof(EnemyBrain))]`. `[UseWithGraph]` is ignored by state machines.
100
+
101
+ ## 4. Transitions and rules
102
+
103
+ Users create transitions by dragging from a state's edge (Shift + left mouse also starts one). In
104
+ code use `stateMachine.Connect(from, to)`.
105
+
106
+ Members are in `itransition.md`, `itransitionrule.md` and `igroupcondition.md`. A transition always
107
+ keeps at least one rule; removing the last one is refused. Each rule's `RootCondition` is an
108
+ `IGroupCondition` whose `Operation` is `GroupConditionOperation.And` or `GroupConditionOperation.Or`;
109
+ `Get()` enumerates its children, `Count` and `Get(int)` index them. Regular transitions are styled through
110
+ `ITransition` properties, not subclassed.
111
+
112
+ ## 5. Conditions
113
+
114
+ ```csharp
115
+ [Serializable]
116
+ [Condition("Distance to player")] // title in the Add menu of a rule
117
+ class DistanceCondition : Condition<float>
118
+ {
119
+ public override string Tooltip => "Compared against the distance to the player.";
120
+ protected override bool DisplayComparisonDropdown => true;
121
+ protected override IReadOnlyList<ConditionComparison> SupportedComparisons =>
122
+ new[] { ConditionComparison.Less, ConditionComparison.Greater };
123
+ }
124
+
125
+ [Serializable]
126
+ [Condition("Took damage")]
127
+ class TookDamageCondition : Condition { } // valueless trigger, label-only row
128
+ ```
129
+
130
+ - Members are in `condition.md` (both `Condition` and `Condition<T>`) and `conditioncomparison.md`.
131
+ `DisplayComparisonDropdown` defaults to false; override `SupportedComparisons` to limit the operators.
132
+ - Built-in conditions, created in code with `Condition.CreateGroupCondition()` and
133
+ `Condition.CreateVariableCondition(IVariable variable, object defaultValue, ConditionComparison comparison = ConditionComparison.Equal)`.
134
+ Read them through `IGroupCondition` and `IVariableCondition` (`Variable`, `Comparison`, `Value`).
135
+ - Without a `[Condition]` attribute the type name is used as the title. Abstract and open generic
136
+ condition classes are not listed.
137
+ - Same discovery rules as states: same assembly, or `[UseWithStateMachine(...)]`.
138
+
139
+ `Condition` has no lifecycle callbacks, so an `OnEnable` override on a condition does not compile.
140
+ Only `StateMachine`, `State` and `SelfTransition` expose `OnEnable` / `OnDisable` here.
141
+
142
+ Editing a condition value from code: `UndoBeginRecordStateMachine("Set distance", condition)`,
143
+ assign `condition.Value`, `UndoEndRecordStateMachine()`, then `SaveStateMachine`.
144
+
145
+ ## 6. Custom self transitions
146
+
147
+ ```csharp
148
+ [Serializable]
149
+ [UseWithStateMachine(typeof(EnemyBrain))]
150
+ [Transition("", "Icons/Loop.png", "Repeat")] // (categoryPath[, iconPath[, title]])
151
+ class RepeatTransition : SelfTransition
152
+ {
153
+ public override void OnEnable()
154
+ {
155
+ base.OnEnable();
156
+ LineColor = Color.cyan;
157
+ Tooltip = "Loops the state while its conditions hold.";
158
+ }
159
+ }
160
+ ```
161
+
162
+ Custom self transitions appear in a state's Create Transition menu. `SelfTransition` exposes the
163
+ `ITransition` members plus `Tooltip`, `OnEnable`, `OnDisable`. Regular state-to-state transitions are
164
+ not subclassed; style them through `ITransition` properties.
165
+
166
+ ## 7. Variables
167
+
168
+ `stateMachine.CreateVariable<int>("Health", 100)` declares a Blackboard variable that the built-in
169
+ variable condition can compare against. `IVariable.StateMachine` gives the owner. Variable kinds and
170
+ members are the same as in the Graph API.
171
+
172
+ ## 8. Validation with OnStateMachineChanged
173
+
174
+ ```csharp
175
+ public override void OnStateMachineChanged(StateMachineLogger logger)
176
+ {
177
+ foreach (var state in GetStates())
178
+ if (!state.GetOutgoingTransitions().Any() && state is not EndState)
179
+ logger.LogWarning("Dead end: add a transition out of this state.", state);
180
+
181
+ foreach (var change in logger.StateMachineChanges.ChangedTransitions)
182
+ if ((change.ChangeKinds & ChangeKind.Added) != 0) { /* new transition */ }
183
+ }
184
+ ```
185
+
186
+ `StateMachineLogger` and `StateMachineChanges` work like `GraphLogger` and `GraphChanges`
187
+ (`statemachinelogger.md`, `statemachinechanges.md`): pass a state or transition as the context to put
188
+ the marker on it, and attach a `StateMachineLogAction` for a fix button.
189
+
190
+ ## 9. Context menus
191
+
192
+ ```csharp
193
+ [StateMachineMenu(typeof(EnemyBrain))]
194
+ static void AddEntries(StateMachineMenuContext context)
195
+ {
196
+ switch (context.ClickedObject)
197
+ {
198
+ case IState state: context.AppendAction("Log state", () => Debug.Log(state.Title)); break;
199
+ case ITransition transition: context.AppendAction("Log rules", () => Debug.Log(transition.RuleCount)); break;
200
+ default: context.AppendAction("Canvas action", () => { }); break;
201
+ }
202
+ }
203
+
204
+ [ConditionMenu(typeof(EnemyBrain))]
205
+ static void AddConditionEntries(ConditionMenuContext context) // context.StateMachine, .Transition, .Rule
206
+ {
207
+ }
208
+ ```
209
+
210
+ ## 10. Custom UI for states and conditions
211
+
212
+ - `class PatrolView : StateView<PatrolState>`: `State`, `View.Root`, `OnViewBuilt()`,
213
+ `OnViewAttached()`, `OnViewDetached()`, `OnViewLODChanged(float)`, `OnCullingChanged(bool)`.
214
+ Allocate elements in `OnViewBuilt` and re-add them in `OnCullingChanged(false)`; never allocate in
215
+ `OnViewAttached`.
216
+ - `class DistanceView : ConditionView<DistanceCondition>` (no LOD or culling callbacks): `Condition`,
217
+ `View.Root`, `OnViewBuilt()`, `OnViewAttached()`, `OnViewDetached()`, `OnConditionChanged()`, and
218
+ the toggles `protected virtual bool DisplayValueField`, `DisplayTitleLabel`. Add to `Root`; do not
219
+ remove or reparent the built-in row elements. View instances are never serialized.
220
+ - Exceptions thrown by a view are logged and the built-in UI still renders.
221
+
222
+ ## 11. Subgraph states
223
+
224
+ With `StateMachineOptions.SupportsSubgraphs`, a state can hold a nested state machine.
225
+ `ISubgraphState : IState` marks such states; `StateMachineChanges.ChangedSubgraphStates` reports them.
226
+
227
+ ## 12. Reading a state machine for a runtime
228
+
229
+ ```csharp
230
+ [ScriptedImporter(1, EnemyBrain.AssetExtension)]
231
+ class EnemyBrainImporter : ScriptedImporter
232
+ {
233
+ public override void OnImportAsset(AssetImportContext ctx)
234
+ {
235
+ var sm = StateMachineDatabase.LoadStateMachineForImporter<EnemyBrain>(ctx.assetPath);
236
+ if (sm == null) { Debug.LogError($"Failed to load {ctx.assetPath}"); return; }
237
+
238
+ var runtime = ScriptableObject.CreateInstance<RuntimeBrain>();
239
+ foreach (var state in sm.GetStates())
240
+ {
241
+ var rs = new RuntimeState { Id = state.ID, Name = state.Title };
242
+ state.GetOptionByName("Speed")?.TryGetValue<float>(out rs.Speed);
243
+ foreach (var transition in state.GetOutgoingTransitions())
244
+ foreach (var rule in transition.GetRules())
245
+ if (rule.Enabled)
246
+ rs.Transitions.Add(new RuntimeTransition
247
+ {
248
+ Target = transition.ToState.ID,
249
+ Predicate = Compile(rule.RootCondition)
250
+ });
251
+ runtime.States.Add(rs);
252
+ }
253
+ ctx.AddObjectToAsset("Runtime", runtime);
254
+ ctx.SetMainObject(runtime);
255
+ }
256
+
257
+ static RuntimePredicate Compile(ICondition condition) => condition switch
258
+ {
259
+ IGroupCondition g => RuntimePredicate.Group(g.Operation, g.Get().Select(Compile)),
260
+ IVariableCondition v => RuntimePredicate.Variable(v.Variable.Name, v.Comparison, v.Value),
261
+ DistanceCondition d => RuntimePredicate.Distance(d.Comparison, d.Value),
262
+ TookDamageCondition => RuntimePredicate.Trigger("TookDamage"),
263
+ _ => RuntimePredicate.Never
264
+ };
265
+ }
266
+ ```
267
+
268
+ Identify the entry state by a dedicated `State` subclass or a state machine option; the API has no
269
+ built-in "default state". Keep `Hash128` IDs in the runtime asset if the GraphVisualization API will
270
+ highlight states later.
@@ -0,0 +1,49 @@
1
+ # Step 3: Where the docs stop
2
+
3
+ The manual covers the 6.6 Graph API. These parts have no manual page yet, so read the reference file
4
+ before writing code. Paths are relative to this skill's folder.
5
+
6
+ - **Importer to a runtime asset, and wiring the debug view from runtime code:** [`references/runtime-and-visualization.md`](runtime-and-visualization.md).
7
+ The importer always has this shape:
8
+
9
+ ```csharp
10
+ var graph = GraphDatabase.LoadGraphForImporter<MyGraph>(ctx.assetPath); // never LoadGraph here
11
+ if (graph == null) return; // bad path or type: log and stop
12
+ var start = graph.GetNodes().OfType<StartNode>().FirstOrDefault();
13
+ if (start == null) return; // OnGraphChanged already reported it
14
+ var next = start.GetOutputPortByName("Next").FirstConnectedPort?.GetNode(); // null when unconnected
15
+ var titlePort = next.GetInputPortByName("Title");
16
+ titlePort.TryGetValue<string>(out var title); // the value typed on the node
17
+ if (titlePort.IsConnected) { /* resolve titlePort.FirstConnectedPort.GetNode() upstream instead */ }
18
+ ctx.AddObjectToAsset("Runtime", runtime); ctx.SetMainObject(runtime);
19
+ ```
20
+
21
+ The runtime asset keeps `Hash128` IDs as `Hash128` and never references `Unity.GraphToolkit.Editor`.
22
+ - **State machines (6000.7+):** [`references/state-machine-api.md`](state-machine-api.md). The core types:
23
+
24
+ ```csharp
25
+ [StateMachine(AssetExtension)] [Serializable]
26
+ class EnemyBrain : StateMachine
27
+ {
28
+ public const string AssetExtension = "enemybrain";
29
+ [MenuItem("Assets/Create/AI/Enemy Brain")]
30
+ static void Create() => StateMachineDatabase.PromptInProjectBrowserToCreateNewAsset<EnemyBrain>();
31
+ }
32
+
33
+ [Serializable] class Patrol : State { } // no ports; the state machine owns transitions
34
+
35
+ [Serializable] [Condition("Distance to player")]
36
+ class DistanceCondition : Condition<float> // derive from Condition for a valueless trigger
37
+ {
38
+ protected override bool DisplayComparisonDropdown => true;
39
+ }
40
+ ```
41
+
42
+ Validation goes in `OnStateMachineChanged(StateMachineLogger)`. An importer walks
43
+ `GetStates()`, each state's `GetOutgoingTransitions()`, each transition's `GetRules()` and each rule's
44
+ `RootCondition`. That tree always contains built-in conditions, so handle `IGroupCondition` (recurse,
45
+ honor `Operation`, a `GroupConditionOperation` of `And` or `Or`) and `IVariableCondition` before matching custom `Condition<T>` types.
46
+ - **Knowing what changed, and the other 6.7 Graph API additions:** [`references/graph-api-gaps.md`](graph-api-gaps.md).
47
+ On 6000.7+, `logger.GraphChanges.ChangedNodes` reports added and modified nodes. Removed nodes are
48
+ never reported, so on every version, and for all changes on 6000.6, diff a `[NonSerialized]`
49
+ `HashSet<Hash128>` of node IDs against `GetNodes()`.
@@ -0,0 +1,159 @@
1
+ ---
2
+ name: build-live-game
3
+ description: Builds and operates a live game's backend with Unity Gaming Services. Make sure to use this skill when the user wants trusted server-side game logic, player progress, remote configuration, sign-in, achievements, battle passes or leaderboards.
4
+ ---
5
+
6
+ # Build a Live Game With Unity Gaming Services
7
+
8
+ ## Before You Start
9
+
10
+ 1. Read the Editor version from `ProjectSettings/ProjectVersion.txt` and the installed UGS package versions from `Packages/packages-lock.json`. Pick the steps below that match (for example `.ccmu` or `.ccmr` modules), because the right workflow depends on the Editor and package versions.
11
+ 2. Check whether the project is linked to a Unity project ID and environment (**Edit > Project Settings > Services**), and ask the user to link it if it is not.
12
+ 3. Create a restore point you can roll back to if your changes fail: commit the project in version control. If there is no version control, copy the project folder instead.
13
+ 4. Before you go forward with a workflow or diagnosis, open and read the documentation pages for the service you will use (see [Documentation Map](#documentation-map)) and the matching file under `references/`, and name the pages you read in your response. This is because your training knowledge about Unity Gaming Services might be out of date, incorrect, or for the wrong package version.
14
+ 5. Do only what's asked. Don't change unrelated assets or files. Avoid long explanations.
15
+ 6. When you change runtime behaviour, add `Debug.Log` lines at the points you need to verify (sign-in complete, module call returned, config fetched). You read them in Play mode during [Validation](#validation).
16
+
17
+ ## Glossary
18
+
19
+ Read [orientation.md](references/orientation.md#glossary) when a UGS term is ambiguous, such as Building Block, `.ccmu` versus `.ccmr`, CloudBehaviour, or protected versus custom data. It maps each term to what the Editor, the package API and the documentation call it.
20
+
21
+ ## Documentation Map
22
+
23
+ Read [orientation.md](references/orientation.md#documentation-map) before acting on any service, because training knowledge about Unity Gaming Services is often out of date. It lists the pages to read per service and how to version the package URLs.
24
+
25
+ ## UGS Packages
26
+
27
+ | Package | Min Version | Purpose |
28
+ |---|---|---|
29
+ | `com.unity.services.core` | 1.16.0 | Initialization, dependency graph |
30
+ | `com.unity.services.authentication` | 3.6.1 | Player sign-in and identity |
31
+ | `com.unity.services.cloudcode` | 3.0.0 | Server-authoritative C# modules, authored in-project as `.ccmu`. The `2.10.x` line deploys legacy `.ccmr` only — see below |
32
+ | `com.unity.services.cloudsave` | 3.4.0 | Per-player and shared key-value storage |
33
+ | `com.unity.remote-config` | 4.2.5 | Server-side game configuration |
34
+ | `com.unity.services.deployment` | 1.7.2 | Deploy cloud resources from Editor |
35
+ | `com.unity.services.tooling` | 1.4.1 | Access Control and Game Overrides |
36
+ | `com.unity.services.apis` | 1.1.1 | Generated REST clients for all UGS services |
37
+
38
+ - [Before You Start](#before-you-start)
39
+ - [Glossary](#glossary)
40
+ - [Documentation Map](#documentation-map)
41
+ - [Initialization Pattern](#initialization-pattern)
42
+ - [Architecture — How Packages Combine](#architecture--how-packages-combine)
43
+ - [Core Services — Quick Reference](#core-services--quick-reference)
44
+ - [Common Architecture Patterns](#common-architecture-patterns)
45
+ - [Validation](#validation)
46
+ - [Detailed References](#detailed-references)
47
+ - [Final Report](#final-report)
48
+
49
+ ## Initialization Pattern
50
+
51
+ Every UGS game starts the same way. `com.unity.services.core` must initialize first, then the player signs in:
52
+
53
+ ```csharp
54
+ using Unity.Services.Core;
55
+ using Unity.Services.Authentication;
56
+
57
+ await UnityServices.InitializeAsync();
58
+ await AuthenticationService.Instance.SignInAnonymouslyAsync();
59
+ // All other services are now ready
60
+ ```
61
+
62
+ ## Architecture — How Packages Combine
63
+
64
+ ```
65
+ UnityServices.InitializeAsync()
66
+ │
67
+ ▼
68
+ AuthenticationService
69
+ (sign in → PlayerId)
70
+ │
71
+ ┌───────────────┼───────────────┐
72
+ ▼ ▼ ▼
73
+ Remote Config Cloud Save Multiplayer
74
+ (game config, (player state, (sessions,
75
+ definitions, progress, matchmaking,
76
+ feature flags) preferences) lobbies)
77
+ │ │
78
+ └───────┬───────┘
79
+ ▼
80
+ Cloud Code
81
+ (server-authoritative
82
+ writes, validation,
83
+ anti-cheat logic)
84
+ │
85
+ ┌───────┴───────┐
86
+ ▼ ▼
87
+ Cloud Save Leaderboards
88
+ (Protected (score
89
+ writes) submission)
90
+ ```
91
+
92
+ **Key principle:** For any data that affects game integrity (XP, rewards, currency), route writes through Cloud Code modules. Direct client writes are only appropriate for non-sensitive data (preferences, display settings).
93
+
94
+ ## Core Services — Quick Reference
95
+
96
+ Read [services-overview.md](references/services-overview.md) to choose the right package and authoring model for a feature, including when to write `.ccmu` instead of `.ccmr` and when CloudBehaviours apply. It summarises each service, the version that supports it, and the full reference for its API.
97
+
98
+ ## Common Architecture Patterns
99
+
100
+ ### Pattern 1: Config + State + Server Writes
101
+
102
+ Used by **Battle Pass** and **Achievements**:
103
+
104
+ 1. **Definitions** in Remote Config (`.rc` file) — what exists in the game
105
+ 2. **Player state** in Cloud Save — per-player progress
106
+ 3. **Writes via Cloud Code** — server-authoritative mutations
107
+ 4. **Access Control** (`.ac` file) — block direct player writes to sensitive keys
108
+
109
+ ### Pattern 2: Client-Direct Data
110
+
111
+ Used by **Player Account** (preferences, display settings):
112
+
113
+ 1. **Player data** in Cloud Save Default or Public access class
114
+ 2. **Direct client writes** — no Cloud Code needed for non-sensitive data
115
+
116
+ ### Pattern 3: Competitive Features
117
+
118
+ Used by **Leaderboards** and ranked systems:
119
+
120
+ 1. **Score submission** via Leaderboards API (or through Cloud Code for validation)
121
+ 2. **Rankings** retrieved client-side with pagination and player-relative queries
122
+
123
+ ## Validation
124
+
125
+ After writing code for a live game feature, run these checks in order. If one fails, fix the cause and re-run it before moving on; if the fix does not work, go back and reread the matching documentation pages and `references/` file.
126
+
127
+ 1. Check the project compiles: read the Editor console (or the Editor log) and confirm zero compile errors.
128
+ 2. Check the initialization order in the code: search for `UnityServices.InitializeAsync()` and confirm it runs before the sign-in call, and that sign-in completes before any service call.
129
+ 3. Check that sensitive writes (XP, rewards, currency) go through Cloud Code: search the client code for Cloud Save `SaveAsync` calls on those keys and move any you find into a module. Also confirm each Cloud Save read uses the access class of the bucket that was written to, because a mismatched class returns no data.
130
+ 4. Deploy the cloud resource files the feature uses (`.rc`, `.ac`, `.ccmu` or `.ccmr`, `.lb`; skip the types it does not use) to the active environment with the `Deploy.cs` script in `references/deployment.md`, and read its output: every file must report `Success`. A file reported as `not a deployable item`, or with an `Error` status, has failed. If the project does not have both packages the script needs, `com.unity.pipeline` and `com.unity.services.deployment.api`, ask the user to deploy from the Deployment Window and report each file's status.
131
+ 5. Check Access Control by its effect: if the feature deploys an `.ac` policy that denies direct player writes, enter Play mode, run one direct client Cloud Save write to a key the policy covers (a temporary `SaveAsync` call), and confirm it fails with a `403`. Remove the temporary call afterwards. Skip this step when the feature has no `.ac` file.
132
+ 6. Enter Play mode, run the feature once, and confirm the `Debug.Log` lines from [Before You Start](#before-you-start) appear in the order you expect and the console has zero errors.
133
+
134
+ ## Detailed References
135
+
136
+ ### Service References
137
+ - **Authentication** — sign-in methods, events, profiles, identity providers, code templates: [references/authentication.md](references/authentication.md)
138
+ - **Cloud Code** — choosing a model: [references/cloud-code.md](references/cloud-code.md); scripts and modules: [references/cloud-code-modules.md](references/cloud-code-modules.md); CloudBehaviours: [references/cloud-code-cloudbehaviours.md](references/cloud-code-cloudbehaviours.md)
139
+ - **Cloud Save** — access classes, data operations, files, queries, code templates: [references/cloud-save.md](references/cloud-save.md)
140
+ - **Remote Config** — definitions, `.rc` format, Game Overrides, code templates: [references/remote-config.md](references/remote-config.md)
141
+ - **Tooling** — Access Control (`.ac`) policies, Game Overrides (`.ugo`), URN reference: [references/tooling.md](references/tooling.md)
142
+ - **Deployment** — file types, workflow, programmatic API: [references/deployment.md](references/deployment.md)
143
+ - **UGS CLI** — `unity ugs` plugin install, auth/setup, headless deploy by file type: [references/ugs-cli.md](references/ugs-cli.md)
144
+ - **Services APIs** — four client types, service areas, code templates: [references/apis.md](references/apis.md)
145
+
146
+ ### Feature Blueprints
147
+ - **Choosing a starting point** — this skill's blueprints, Asset Store Building Blocks and sample projects, and how to reuse their legacy Cloud Code: [references/blueprints-and-samples.md](references/blueprints-and-samples.md)
148
+ - **Achievements** — full implementation with data models, client code, Cloud Code module, cloud resources: [references/achievements.md](references/achievements.md)
149
+ - **Battle Pass** — implementation with tiered XP, free/premium tracks, Cloud Code module, cloud resources (premium purchase is an integration stub you must complete): [references/battlepass.md](references/battlepass.md)
150
+ - **Player Account** — sign-in flows, identity management, Cloud Save data, code templates: [references/player-account.md](references/player-account.md)
151
+
152
+ ## Final Report
153
+
154
+ When the work is done, end your response with a short report:
155
+
156
+ 1. What you created or changed: files, packages added to `Packages/manifest.json`, and cloud resource files.
157
+ 2. The checks from [Validation](#validation) that you ran and their results, including any you could not run and why.
158
+ 3. Follow-ups only the user can do, for example: deploy the cloud resources to the target environment, link the project to a Unity project ID and environment, complete a stubbed integration (such as battle pass `PurchasePremium`), or restore from the restore point you created if they reject the changes.
159
+ 4. Which documentation pages you read.