@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.
- package/CHANGELOG.md +53 -0
- package/LICENSE-UNITY-COMPANION.md +122 -0
- package/LICENSE.md +31 -0
- package/NOTICE.md +90 -0
- package/README.md +273 -2
- package/cordis.patch.yml +22 -0
- package/docs/design.md +297 -0
- package/icon.svg +16 -0
- package/lib/frontmatter.js +392 -0
- package/lib/gating.js +105 -0
- package/lib/harness.js +16 -0
- package/lib/index.js +171 -0
- package/lib/project.js +210 -0
- package/lib/registry.js +268 -0
- package/lib/requirements.js +214 -0
- package/lib/skills.js +191 -0
- package/lib/types/frontmatter.d.ts +84 -0
- package/lib/types/gating.d.ts +80 -0
- package/lib/types/harness.d.ts +152 -0
- package/lib/types/index.d.ts +75 -0
- package/lib/types/project.d.ts +93 -0
- package/lib/types/registry.d.ts +96 -0
- package/lib/types/requirements.d.ts +67 -0
- package/lib/types/skills.d.ts +54 -0
- package/lib/types/watch.d.ts +34 -0
- package/lib/watch.js +84 -0
- package/locale/en.json +6 -0
- package/locale/zh.json +6 -0
- package/package.json +70 -4
- package/skills/2d-pixel-perfect/SKILL.md +208 -0
- package/skills/2d-pixel-perfect/references/api-reference.md +81 -0
- package/skills/2d-pixel-perfect/references/camera-setup-builtin.cs +40 -0
- package/skills/2d-pixel-perfect/references/camera-setup-urp.cs +49 -0
- package/skills/2d-pixel-perfect/references/pipeline-detection.cs +50 -0
- package/skills/2d-pixel-perfect/references/sprite-settings.cs +37 -0
- package/skills/asset-transformer-toolkit/SECURITY.md +15 -0
- package/skills/asset-transformer-toolkit/SKILL.md +39 -0
- package/skills/asset-transformer-toolkit/references/create-importer.md +121 -0
- package/skills/asset-transformer-toolkit/references/lods.md +61 -0
- package/skills/asset-transformer-toolkit/references/rule-api.md +154 -0
- package/skills/asset-transformer-toolkit/references/ruleblock-api.md +37 -0
- package/skills/asset-transformer-toolkit/references/ruleset-api.md +138 -0
- package/skills/asset-transformer-toolkit/references/rulesets-and-actions.md +227 -0
- package/skills/audio-setup-mixers/SECURITY.md +16 -0
- package/skills/audio-setup-mixers/SKILL.md +127 -0
- package/skills/audio-setup-mixers/references/api.md +162 -0
- package/skills/build-gtk/SECURITY.md +16 -0
- package/skills/build-gtk/SKILL.md +200 -0
- package/skills/build-gtk/references/api-reference.md +33 -0
- package/skills/build-gtk/references/graph-api-gaps.md +96 -0
- package/skills/build-gtk/references/runtime-and-visualization.md +191 -0
- package/skills/build-gtk/references/state-machine-api.md +270 -0
- package/skills/build-gtk/references/where-the-docs-stop.md +49 -0
- package/skills/build-live-game/SKILL.md +159 -0
- package/skills/build-live-game/references/achievements.md +757 -0
- package/skills/build-live-game/references/apis.md +271 -0
- package/skills/build-live-game/references/authentication.md +431 -0
- package/skills/build-live-game/references/battlepass.md +904 -0
- package/skills/build-live-game/references/blueprints-and-samples.md +75 -0
- package/skills/build-live-game/references/cloud-code-cloudbehaviours.md +1111 -0
- package/skills/build-live-game/references/cloud-code-modules.md +1276 -0
- package/skills/build-live-game/references/cloud-code.md +58 -0
- package/skills/build-live-game/references/cloud-save.md +464 -0
- package/skills/build-live-game/references/deployment.md +231 -0
- package/skills/build-live-game/references/orientation.md +30 -0
- package/skills/build-live-game/references/player-account.md +821 -0
- package/skills/build-live-game/references/remote-config.md +96 -0
- package/skills/build-live-game/references/services-overview.md +76 -0
- package/skills/build-live-game/references/tooling.md +375 -0
- package/skills/build-live-game/references/ugs-cli.md +86 -0
- package/skills/craft-game-floors/SECURITY.md +23 -0
- package/skills/craft-game-floors/SKILL.md +134 -0
- package/skills/craft-game-floors/references/art-direction.md +85 -0
- package/skills/craft-game-floors/references/camera-rigs.md +51 -0
- package/skills/craft-game-floors/references/character-motion.md +35 -0
- package/skills/craft-game-floors/references/game-audio.md +47 -0
- package/skills/craft-game-floors/references/game-feel.md +68 -0
- package/skills/craft-game-floors/references/game-shell.md +45 -0
- package/skills/craft-game-floors/references/live-floor.md +35 -0
- package/skills/craft-game-floors/references/placeholder-assets.md +35 -0
- package/skills/craft-game-floors/references/scene-lighting.md +52 -0
- package/skills/craft-game-floors/references/toon-shading.md +34 -0
- package/skills/craft-game-floors/references/vfx.md +40 -0
- package/skills/craft-game-floors/references/visual-scorecard.md +43 -0
- package/skills/create-2d-physics/SECURITY.md +16 -0
- package/skills/create-2d-physics/SKILL.md +128 -0
- package/skills/create-2d-physics/references/2d-physics-core.md +155 -0
- package/skills/create-2d-physics/references/legacy-2d-physics.md +45 -0
- package/skills/create-tile-palette-or-rule-tiles/SKILL.md +95 -0
- package/skills/create-tile-palette-or-rule-tiles/references/hexagonalruletile.md +71 -0
- package/skills/create-tile-palette-or-rule-tiles/references/palette-create.md +38 -0
- package/skills/create-tile-palette-or-rule-tiles/references/ruletile-createempty.md +37 -0
- package/skills/create-tile-palette-or-rule-tiles/references/ruletile-createfromsegment.md +219 -0
- package/skills/create-tile-palette-or-rule-tiles/references/ruletile.md +95 -0
- package/skills/create-tile-palette-or-rule-tiles/scripts/CreatePaletteTemplate.cs +148 -0
- package/skills/create-tile-palette-or-rule-tiles/scripts/ManualWorkflowExample.cs +63 -0
- package/skills/create-tile-palette-or-rule-tiles/scripts/RuleTileGenerator.cs +61 -0
- package/skills/create-tile-palette-or-rule-tiles/scripts/TilemapRuleTileCreateFromSegment.cs +225 -0
- package/skills/fix-3d-physics-collisions/SECURITY.md +17 -0
- package/skills/fix-3d-physics-collisions/SKILL.md +139 -0
- package/skills/fix-3d-physics-collisions/references/collision-checklist.md +80 -0
- package/skills/fix-3d-physics-collisions/references/collision-debugger.md +18 -0
- package/skills/fix-3d-physics-collisions/references/console-errors-table.md +9 -0
- package/skills/fix-3d-physics-collisions/references/kinematic-trigger-facts.md +18 -0
- package/skills/fix-3d-physics-collisions/references/other-symptoms.md +29 -0
- package/skills/fix-3d-physics-collisions/references/raycast-checklist.md +8 -0
- package/skills/fix-3d-physics-collisions/references/topic-map.md +42 -0
- package/skills/fix-3d-physics-collisions/references/trigger-checklist.md +9 -0
- package/skills/fix-3d-physics-collisions/scripts/CollisionDebugger.cs +561 -0
- package/skills/generate-editor-search-query/SECURITY.md +17 -0
- package/skills/generate-editor-search-query/SKILL.md +117 -0
- package/skills/generate-editor-search-query/references/open-search-window.md +70 -0
- package/skills/generate-editor-search-query/references/query-patterns.md +124 -0
- package/skills/implement-in-app-purchases/SKILL.md +82 -0
- package/skills/implement-in-app-purchases/references/api-details.md +41 -0
- package/skills/implement-in-app-purchases/references/api-notes.md +105 -0
- package/skills/implement-in-app-purchases/references/codeless-catalog.md +197 -0
- package/skills/implement-in-app-purchases/references/convert-adapty.md +270 -0
- package/skills/implement-in-app-purchases/references/convert-essentialkit.md +239 -0
- package/skills/implement-in-app-purchases/references/convert-revenuecat.md +277 -0
- package/skills/implement-in-app-purchases/references/convert-unipay.md +145 -0
- package/skills/implement-in-app-purchases/references/migration-v4-to-v5.md +46 -0
- package/skills/implement-in-app-purchases/references/path-add-iap-to-new-project.md +197 -0
- package/skills/implement-in-app-purchases/references/path-convert-native-google-billing.md +302 -0
- package/skills/implement-in-app-purchases/references/path-convert-native-storekit.md +357 -0
- package/skills/implement-in-app-purchases/references/path-implement-iap-d2c.md +253 -0
- package/skills/implement-in-app-purchases/references/platform-notes.md +55 -0
- package/skills/implement-in-app-purchases/references/pre-check.md +207 -0
- package/skills/implement-in-app-purchases/references/topic-map.md +46 -0
- package/skills/initialize-ai-navigation/SKILL.md +109 -0
- package/skills/initialize-ai-navigation/references/navigation-system.md +793 -0
- package/skills/initialize-ai-navigation/references/topic-map.md +66 -0
- package/skills/levelplay-unity-integration/SKILL.md +122 -0
- package/skills/levelplay-unity-integration/references/adding-more-ad-formats.md +15 -0
- package/skills/levelplay-unity-integration/references/banner-api.md +927 -0
- package/skills/levelplay-unity-integration/references/best-practices.md +604 -0
- package/skills/levelplay-unity-integration/references/dependency-resolution.md +94 -0
- package/skills/levelplay-unity-integration/references/examples.md +10 -0
- package/skills/levelplay-unity-integration/references/ilrd-api.md +337 -0
- package/skills/levelplay-unity-integration/references/initialization-api.md +851 -0
- package/skills/levelplay-unity-integration/references/interstitial-api.md +907 -0
- package/skills/levelplay-unity-integration/references/ios-setup.md +463 -0
- package/skills/levelplay-unity-integration/references/migration-sdk-9.md +666 -0
- package/skills/levelplay-unity-integration/references/privacy-settings.md +593 -0
- package/skills/levelplay-unity-integration/references/production-release-checklist.md +22 -0
- package/skills/levelplay-unity-integration/references/rewarded-api.md +918 -0
- package/skills/levelplay-unity-integration/references/step-0-new-or-migration.md +8 -0
- package/skills/levelplay-unity-integration/references/step-1-verify-environment.md +4 -0
- package/skills/levelplay-unity-integration/references/step-10-testing.md +15 -0
- package/skills/levelplay-unity-integration/references/step-2-business-goals.md +12 -0
- package/skills/levelplay-unity-integration/references/step-3-install-sdk.md +55 -0
- package/skills/levelplay-unity-integration/references/step-4-native-dependencies.md +22 -0
- package/skills/levelplay-unity-integration/references/step-5-app-key-and-ad-units.md +18 -0
- package/skills/levelplay-unity-integration/references/step-6-5-privacy-and-regulation.md +51 -0
- package/skills/levelplay-unity-integration/references/step-6-admob-keys.md +16 -0
- package/skills/levelplay-unity-integration/references/step-7-initialize.md +50 -0
- package/skills/levelplay-unity-integration/references/step-8-ad-unit-strategy.md +16 -0
- package/skills/levelplay-unity-integration/references/step-9-implement-ad-units.md +66 -0
- package/skills/levelplay-unity-integration/references/testing-and-validation.md +222 -0
- package/skills/levelplay-unity-integration/references/troubleshooting.md +99 -0
- package/skills/localize-unity-project/SKILL.md +159 -0
- package/skills/localize-unity-project/references/api-notes.md +15 -0
- package/skills/localize-unity-project/references/cjk-fonts.md +83 -0
- package/skills/localize-unity-project/references/docs-map.md +42 -0
- package/skills/localize-unity-project/references/documentation-lookup.md +33 -0
- package/skills/localize-unity-project/references/locale-switching.md +17 -0
- package/skills/localize-unity-project/references/table-completeness-check.md +47 -0
- package/skills/localize-unity-project/references/translating-existing-project.md +47 -0
- package/skills/localize-unity-project/references/translation-strategy.md +41 -0
- package/skills/localize-unity-project/references/troubleshooting.md +12 -0
- package/skills/localize-unity-project/scripts/L10nBatchProcessor.cs +191 -0
- package/skills/localize-unity-project/scripts/LocalizedFontAsset.cs +18 -0
- package/skills/manage-sprite-atlas/SKILL.md +202 -0
- package/skills/manage-sprite-atlas/references/addressables-delivery.md +58 -0
- package/skills/manage-sprite-atlas/references/advanced-manual-authoring.md +19 -0
- package/skills/manage-sprite-atlas/references/api.md +382 -0
- package/skills/manage-sprite-atlas/references/best-practices.md +183 -0
- package/skills/manage-sprite-atlas/references/common-errors.md +123 -0
- package/skills/manage-sprite-atlas/references/complete-workflow.md +61 -0
- package/skills/manage-sprite-atlas/references/custom-packing.md +147 -0
- package/skills/manage-sprite-atlas/references/delivery-mechanism.md +30 -0
- package/skills/manage-sprite-atlas/references/key-requirements.md +21 -0
- package/skills/manage-sprite-atlas/references/manual-authoring.md +39 -0
- package/skills/manage-sprite-atlas/references/namespaces.md +15 -0
- package/skills/manage-sprite-atlas/references/v2-architecture.md +21 -0
- package/skills/manage-sprite-atlas/resources/authoringvsruntime.cs +176 -0
- package/skills/manage-sprite-atlas/resources/buildaddressablespostprocess.cs +59 -0
- package/skills/manage-sprite-atlas/resources/cacheloadedatlases.cs +145 -0
- package/skills/manage-sprite-atlas/resources/cleanupbatchoperations.cs +119 -0
- package/skills/manage-sprite-atlas/resources/createandconfiguremasteratlas.cs +57 -0
- package/skills/manage-sprite-atlas/resources/custompackersetup.cs +88 -0
- package/skills/manage-sprite-atlas/resources/deprecatedmethods.cs +142 -0
- package/skills/manage-sprite-atlas/resources/dontmodifywithoutsaving.cs +120 -0
- package/skills/manage-sprite-atlas/resources/dontpackinruntimebuilds.cs +190 -0
- package/skills/manage-sprite-atlas/resources/dontscriptspriteatlasineditor.cs +114 -0
- package/skills/manage-sprite-atlas/resources/editorconfiguration.cs +95 -0
- package/skills/manage-sprite-atlas/resources/enablespritepacking.cs +172 -0
- package/skills/manage-sprite-atlas/resources/gridspritepacker.cs +50 -0
- package/skills/manage-sprite-atlas/resources/handlelatebinding.cs +147 -0
- package/skills/manage-sprite-atlas/resources/handlenullcases.cs +141 -0
- package/skills/manage-sprite-atlas/resources/migratev1tov2.cs +335 -0
- package/skills/manage-sprite-atlas/resources/multipagepacker.cs +80 -0
- package/skills/manage-sprite-atlas/resources/optimizetexturesettings.cs +191 -0
- package/skills/manage-sprite-atlas/resources/packerdebugging.cs +158 -0
- package/skills/manage-sprite-atlas/resources/packtransform.cs +51 -0
- package/skills/manage-sprite-atlas/resources/platformnames.cs +127 -0
- package/skills/manage-sprite-atlas/resources/queryspritesefficiently.cs +222 -0
- package/skills/manage-sprite-atlas/resources/registercallbacks.cs +152 -0
- package/skills/manage-sprite-atlas/resources/runtimeatlasloader.cs +15 -0
- package/skills/manage-sprite-atlas/resources/runtimespriteaccess.cs +19 -0
- package/skills/manage-sprite-atlas/resources/savespriteatlasasset.cs +107 -0
- package/skills/manage-sprite-atlas/resources/scriptablepacker.cs +81 -0
- package/skills/manage-sprite-atlas/resources/setincludeinbuild.cs +164 -0
- package/skills/manage-sprite-atlas/resources/sizeoptimizedpacker.cs +88 -0
- package/skills/manage-sprite-atlas/resources/spriteatlaslatebinding.cs +123 -0
- package/skills/manage-sprite-atlas/resources/spriteatlasprebuildgenerator.cs +219 -0
- package/skills/manage-sprite-atlas/resources/spritedata.cs +35 -0
- package/skills/manage-sprite-atlas/resources/spritepack.cs +39 -0
- package/skills/manage-sprite-atlas/resources/texturedata.cs +15 -0
- package/skills/manage-sprite-atlas/resources/updatebuildscripts.cs +357 -0
- package/skills/manage-sprite-atlas/resources/updatesettingsconfiguration.cs +135 -0
- package/skills/manage-sprite-atlas/resources/usevariantswisely.cs +179 -0
- package/skills/manage-sprite-atlas/resources/variantatlas.cs +39 -0
- package/skills/migrate-birp-to-urp/SECURITY.md +16 -0
- package/skills/migrate-birp-to-urp/SKILL.md +167 -0
- package/skills/migrate-birp-to-urp/references/capturing-the-editor.md +66 -0
- package/skills/migrate-birp-to-urp/references/complex-shader-situations.md +272 -0
- package/skills/migrate-birp-to-urp/references/conversion-and-rendering-triage.md +113 -0
- package/skills/migrate-birp-to-urp/references/custom-shader-triage.md +123 -0
- package/skills/migrate-birp-to-urp/references/implementation-patterns.md +529 -0
- package/skills/migrate-birp-to-urp/references/migration-workflow.md +265 -0
- package/skills/migrate-birp-to-urp/references/parity-validation-and-troubleshooting.md +114 -0
- package/skills/migrate-birp-to-urp/references/preflight-and-urp-setup.md +195 -0
- package/skills/migrate-birp-to-urp/references/quality-settings-map.md +69 -0
- package/skills/new-unity-project/SECURITY.md +26 -0
- package/skills/new-unity-project/SKILL.md +171 -0
- package/skills/new-unity-project/references/checklist.md +18 -0
- package/skills/new-unity-project/references/common-mistakes.md +15 -0
- package/skills/new-unity-project/references/skill-setup.md +66 -0
- package/skills/new-unity-project/references/step-1-concept.md +13 -0
- package/skills/new-unity-project/references/step-2-platforms-and-create.md +31 -0
- package/skills/new-unity-project/references/step-3-join-and-reconcile.md +16 -0
- package/skills/new-unity-project/references/step-4-source-control.md +9 -0
- package/skills/new-unity-project/references/step-5-packages.md +18 -0
- package/skills/new-unity-project/references/step-6-identity-and-floors.md +20 -0
- package/skills/new-unity-project/references/step-7-visual-baseline.md +75 -0
- package/skills/new-unity-project/references/step-8-first-commit.md +21 -0
- package/skills/new-unity-project/references/step-9-handoff.md +23 -0
- package/skills/optimize-audio/SECURITY.md +16 -0
- package/skills/optimize-audio/SKILL.md +120 -0
- package/skills/optimize-audio/references/diagnostics.md +42 -0
- package/skills/optimize-audio/references/troubleshooting.md +41 -0
- package/skills/optimize-audio/resources/audio-import-api.md +149 -0
- package/skills/optimize-audio/resources/platform-settings.md +48 -0
- package/skills/optimize-text-mesh-pro/SKILL.md +181 -0
- package/skills/optimize-text-mesh-pro/references/dynamic-atlas-and-profiling.md +28 -0
- package/skills/optimize-text-mesh-pro/references/topic-map.md +36 -0
- package/skills/optimize-web/SECURITY.md +16 -0
- package/skills/optimize-web/SKILL.md +157 -0
- package/skills/optimize-web/references/editor-csharp.md +120 -0
- package/skills/optimize-web/references/topic-map.md +49 -0
- package/skills/optimize-web/references/troubleshooting.md +45 -0
- package/skills/optimize-web/references/understand-request.md +19 -0
- package/skills/optimize-web/references/web-assets-quality.md +59 -0
- package/skills/optimize-web/references/web-player-settings.md +39 -0
- package/skills/optimize-web/references/web-profiling-memory.md +71 -0
- package/skills/optimize-web/scripts/WebOptimizer.cs +46 -0
- package/skills/optimize-web/scripts/toktx-examples.sh +11 -0
- package/skills/setup-multiplayer-services/SKILL.md +36 -0
- package/skills/setup-multiplayer-services/references/dgs-entrypoint.md +79 -0
- package/skills/setup-multiplayer-services/references/entrypoints.md +213 -0
- package/skills/setup-multiplayer-services/references/examples.md +33 -0
- package/skills/setup-multiplayer-services/references/implementation-fit.md +30 -0
- package/skills/setup-multiplayer-services/references/underlying-services.md +11 -0
- package/skills/setup-multiplayer-services/references/workflows-prerequisites.md +17 -0
- package/skills/setup-vivox-voice-chat/SECURITY.md +16 -0
- package/skills/setup-vivox-voice-chat/SKILL.md +166 -0
- package/skills/setup-vivox-voice-chat/references/api-reference-lookup.md +28 -0
- package/skills/setup-vivox-voice-chat/references/docs-topic-map.md +13 -0
- package/skills/setup-vivox-voice-chat/references/events-and-participants.md +79 -0
- package/skills/setup-vivox-voice-chat/references/init-and-login.md +92 -0
- package/skills/setup-vivox-voice-chat/references/text-chat.md +93 -0
- package/skills/setup-vivox-voice-chat/references/troubleshooting.md +47 -0
- package/skills/setup-vivox-voice-chat/references/voice-channels.md +92 -0
- package/skills/shader-graph-create-custom-node/SKILL.md +25 -0
- package/skills/shader-graph-create-custom-node/resources/all_hints.hlsl +182 -0
- package/skills/sprite-editor/SECURITY.md +16 -0
- package/skills/sprite-editor/SKILL.md +66 -0
- package/skills/sprite-editor/references/api_reference.md +151 -0
- package/skills/sprite-editor/references/background.md +112 -0
- package/skills/sprite-editor/references/templates.md +72 -0
- package/skills/sprite-editor/scripts/AutomaticSliceTexture.cs +40 -0
- package/skills/sprite-editor/scripts/GenerateNewSpriteRects.cs +200 -0
- package/skills/sprite-editor/scripts/GetTextureSourceImageSize.cs +32 -0
- package/skills/sprite-editor/scripts/GetTextureToSlice.cs +55 -0
- package/skills/sprite-editor/scripts/GridSliceTexture.cs +40 -0
- package/skills/sprite-editor/scripts/IsometricSliceTexture.cs +141 -0
- package/skills/sprite-editor/scripts/README.md +134 -0
- package/skills/sprite-editor/scripts/SetPivotExample.cs +58 -0
- package/skills/sprite-editor/scripts/SpriteToPng.cs +88 -0
- package/skills/sprite-segment-3x3grid/SKILL.md +177 -0
- package/skills/sprite-segment-3x3grid/references/topic-map.md +37 -0
- package/skills/sprite-segment-3x3grid/scripts/SpriteGridAnalysis.cs +119 -0
- package/skills/ui/SKILL.md +142 -0
- package/skills/ui-imgui/SKILL.md +180 -0
- package/skills/ui-imgui/references/gui-elements.md +156 -0
- package/skills/ui-imgui/references/templates.md +141 -0
- package/skills/ui-ugui/SKILL.md +217 -0
- package/skills/ui-ugui/references/layout-and-anchors.md +61 -0
- package/skills/ui-ugui/references/scrollview-setup.md +29 -0
- package/skills/ui-uitk/SKILL.md +229 -0
- package/skills/ui-uitk/references/common-issues.md +74 -0
- package/skills/ui-uitk/references/custom-elements.md +241 -0
- package/skills/ui-uitk/references/painter2d.md +282 -0
- package/skills/ui-uitk/references/pointermanipulator-guide.md +94 -0
- package/skills/ui-uitk/references/svg-icons.md +136 -0
- package/skills/ui-uitk/references/ui-runtime-binding.md +234 -0
- package/skills/ui-uitk/references/uss-guide.md +138 -0
- package/skills/unity-cli/CHANGELOG.md +524 -0
- package/skills/unity-cli/SECURITY.md +68 -0
- package/skills/unity-cli/SKILL.md +160 -0
- package/skills/unity-cli/references/auth-license-cloud.md +318 -0
- package/skills/unity-cli/references/bootstrap-project.md +177 -0
- package/skills/unity-cli/references/build-run-test.md +555 -0
- package/skills/unity-cli/references/catalog-plugins.md +86 -0
- package/skills/unity-cli/references/ci-recipes.md +76 -0
- package/skills/unity-cli/references/cloud-automation.md +819 -0
- package/skills/unity-cli/references/cloud-workflows.md +19 -0
- package/skills/unity-cli/references/collaboration.md +533 -0
- package/skills/unity-cli/references/config-hub.md +239 -0
- package/skills/unity-cli/references/diagnostics-maintenance.md +718 -0
- package/skills/unity-cli/references/docs-workflow.md +179 -0
- package/skills/unity-cli/references/editor-targeting.md +29 -0
- package/skills/unity-cli/references/editors-install.md +490 -0
- package/skills/unity-cli/references/environment-variables.md +42 -0
- package/skills/unity-cli/references/exit-codes.md +47 -0
- package/skills/unity-cli/references/global-flags.md +32 -0
- package/skills/unity-cli/references/integration-advanced.md +1130 -0
- package/skills/unity-cli/references/notes.md +20 -0
- package/skills/unity-cli/references/notifications.md +39 -0
- package/skills/unity-cli/references/playmode-verification-loop.md +279 -0
- package/skills/unity-cli/references/projects-templates.md +997 -0
- package/skills/unity-cli/references/scene-editing-preflight.md +25 -0
- package/skills/unity-cli/references/setup-and-help.md +54 -0
- package/skills/unity-cli/references/version-control.md +612 -0
- package/skills/unity-package-management/SKILL.md +169 -0
- package/skills/unity-package-management/references/discovering-packages.md +66 -0
- package/skills/unity-package-management/references/headless-run.md +31 -0
- package/skills/unity-package-management/references/installer-script.md +92 -0
- package/skills/unity-package-management/references/select-packages.md +126 -0
- package/skills/unity-pipeline/SECURITY.md +17 -0
- package/skills/unity-pipeline/SKILL.md +205 -0
- package/skills/unity-pipeline/references/csharp-eval.md +23 -0
- package/skills/unity-pipeline/references/multiplayer-play-mode.md +103 -0
- package/skills/urp-postprocessing/SECURITY.md +16 -0
- package/skills/urp-postprocessing/SKILL.md +188 -0
- package/skills/urp-postprocessing/references/code-templates.md +150 -0
- package/skills/urp-postprocessing/references/effect-reference.md +86 -0
- package/skills/validate-urp-render-graph-renderer-feature/SKILL.md +92 -0
- package/skills/validate-urp-render-graph-renderer-feature/references/validation-checklist.md +179 -0
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
using UnityEngine;
|
|
2
|
+
using UnityEditor;
|
|
3
|
+
using UnityEditor.SceneManagement;
|
|
4
|
+
using UnityEngine.UI;
|
|
5
|
+
using UnityEditor.Events;
|
|
6
|
+
using UnityEngine.Events;
|
|
7
|
+
using UnityEngine.Localization.Components;
|
|
8
|
+
using System.Collections.Generic;
|
|
9
|
+
using System.Linq;
|
|
10
|
+
using TMPro;
|
|
11
|
+
|
|
12
|
+
/// <summary>
|
|
13
|
+
/// Batch-processes all scenes in the project, attaching LocalizeStringEvent components
|
|
14
|
+
/// to every text element whose content matches a key in the provided mapping.
|
|
15
|
+
///
|
|
16
|
+
/// Covers BOTH legacy UnityEngine.UI.Text and TextMeshPro (TMP_Text, which is the base of
|
|
17
|
+
/// TextMeshProUGUI and TextMeshPro). Walking only one of the two is the usual mistake and it
|
|
18
|
+
/// fails silently: measured on a real project, FindObjectsByType<Text> found 1 component
|
|
19
|
+
/// while FindObjectsByType<TMP_Text> found 13, so a Text-only pass reports success having
|
|
20
|
+
/// localized almost nothing.
|
|
21
|
+
///
|
|
22
|
+
/// LocalizeAll() modifies and saves every scene under Assets/, so it enforces its own safeguards
|
|
23
|
+
/// in code rather than relying on the caller: it refuses to run in batch mode, asks the user to
|
|
24
|
+
/// save or discard unsaved scene changes, and shows a blocking confirmation dialog listing the
|
|
25
|
+
/// scenes it will rewrite. Nothing is written unless the user clicks the confirm button.
|
|
26
|
+
/// It also reports what it did NOT convert; see the return value of LocalizeHierarchy.
|
|
27
|
+
/// </summary>
|
|
28
|
+
public static class L10nBatchProcessor
|
|
29
|
+
{
|
|
30
|
+
/// <summary>Localizes every scene. Returns the labels that matched no mapping entry.</summary>
|
|
31
|
+
public static List<string> LocalizeAll(Dictionary<string, string> mapping, string table)
|
|
32
|
+
{
|
|
33
|
+
var unmatched = new List<string>();
|
|
34
|
+
|
|
35
|
+
// Scope the search to Assets/. An unscoped FindAssets searches the whole project INCLUDING
|
|
36
|
+
// read-only packages, so it returns package test scenes and this loop then tries to open,
|
|
37
|
+
// dirty and save assets it must not touch. Measured on a real project: unscoped found 20
|
|
38
|
+
// scenes where the project has 1, and all 19 extras were inside read-only packages
|
|
39
|
+
// (com.unity.addressables test fixtures).
|
|
40
|
+
var scenePaths = AssetDatabase.FindAssets("t:Scene", new[] { "Assets" })
|
|
41
|
+
.Select(guid => AssetDatabase.GUIDToAssetPath(guid))
|
|
42
|
+
.ToList();
|
|
43
|
+
|
|
44
|
+
// The safeguards live here, in the code path that does the writes, so skipping a
|
|
45
|
+
// sentence in the documentation cannot skip them.
|
|
46
|
+
//
|
|
47
|
+
// 1. Batch mode: EditorUtility.DisplayDialog returns true without showing anything when
|
|
48
|
+
// the Editor runs headless, which would turn the confirmation below into a no-op.
|
|
49
|
+
if (Application.isBatchMode)
|
|
50
|
+
{
|
|
51
|
+
throw new System.InvalidOperationException(
|
|
52
|
+
"L10nBatchProcessor.LocalizeAll rewrites every scene and needs a user to confirm it " +
|
|
53
|
+
"in an interactive Editor. It does not run in batch mode.");
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
// 2. Unsaved work: OpenScene(..., Single) below closes whatever is open. Let the user save
|
|
57
|
+
// or discard it first; Cancel aborts the whole run.
|
|
58
|
+
if (!EditorSceneManager.SaveCurrentModifiedScenesIfUserWantsTo())
|
|
59
|
+
{
|
|
60
|
+
throw new System.OperationCanceledException(
|
|
61
|
+
"Localization batch cancelled: the open scenes have unsaved changes.");
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
// 3. Explicit confirmation of the destructive write, naming what will change.
|
|
65
|
+
const int listed = 10;
|
|
66
|
+
var preview = string.Join("\n", scenePaths.Take(listed));
|
|
67
|
+
if (scenePaths.Count > listed)
|
|
68
|
+
{
|
|
69
|
+
preview += $"\n... and {scenePaths.Count - listed} more";
|
|
70
|
+
}
|
|
71
|
+
var confirmed = EditorUtility.DisplayDialog(
|
|
72
|
+
"Localize all scenes?",
|
|
73
|
+
$"This opens {scenePaths.Count} scene(s) under Assets/, attaches LocalizeStringEvent " +
|
|
74
|
+
$"components to matching text, and saves each scene. It cannot be undone from here; " +
|
|
75
|
+
$"use version control to revert.\n\n{preview}",
|
|
76
|
+
$"Localize {scenePaths.Count} scene(s)",
|
|
77
|
+
"Cancel");
|
|
78
|
+
if (!confirmed)
|
|
79
|
+
{
|
|
80
|
+
throw new System.OperationCanceledException("Localization batch cancelled by the user.");
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
// Restore the user's scene layout afterwards, so the batch doesn't leave them looking at
|
|
84
|
+
// whichever scene happened to be processed last.
|
|
85
|
+
var originalSetup = EditorSceneManager.GetSceneManagerSetup();
|
|
86
|
+
try
|
|
87
|
+
{
|
|
88
|
+
foreach (var path in scenePaths)
|
|
89
|
+
{
|
|
90
|
+
var scene = EditorSceneManager.OpenScene(path, OpenSceneMode.Single);
|
|
91
|
+
unmatched.AddRange(LocalizeHierarchy(mapping, table, path));
|
|
92
|
+
EditorSceneManager.MarkSceneDirty(scene);
|
|
93
|
+
EditorSceneManager.SaveScene(scene);
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
finally
|
|
97
|
+
{
|
|
98
|
+
// An untitled scene has no path to reopen, so only restore a layout made of saved scenes.
|
|
99
|
+
if (originalSetup.Length > 0 && originalSetup.All(s => !string.IsNullOrEmpty(s.path)))
|
|
100
|
+
{
|
|
101
|
+
EditorSceneManager.RestoreSceneManagerSetup(originalSetup);
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
return unmatched;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
/// <summary>
|
|
108
|
+
/// Wires the open scene. Returns "scene :: object :: text" for every label that was found
|
|
109
|
+
/// but matched no mapping entry, so partial coverage is reported rather than silent.
|
|
110
|
+
/// </summary>
|
|
111
|
+
static List<string> LocalizeHierarchy(
|
|
112
|
+
Dictionary<string, string> mapping, string table, string scenePath)
|
|
113
|
+
{
|
|
114
|
+
var unmatched = new List<string>();
|
|
115
|
+
|
|
116
|
+
// Both component families. TMP_Text is abstract and covers TextMeshProUGUI and TextMeshPro.
|
|
117
|
+
var labels = new List<Component>();
|
|
118
|
+
labels.AddRange(Object.FindObjectsByType<Text>(
|
|
119
|
+
FindObjectsInactive.Include, FindObjectsSortMode.None));
|
|
120
|
+
labels.AddRange(Object.FindObjectsByType<TMP_Text>(
|
|
121
|
+
FindObjectsInactive.Include, FindObjectsSortMode.None));
|
|
122
|
+
|
|
123
|
+
// Longest key first. A label reading "NO ITEMS FOUND" must bind to that key rather
|
|
124
|
+
// than to a shorter "NO" that is a substring of it -- the case SKILL.md's mapping
|
|
125
|
+
// guidance calls out. Dictionary enumeration order is unspecified, so without this
|
|
126
|
+
// the binding is not just wrong but irreproducible; and because the loop below breaks
|
|
127
|
+
// on the first hit and marks the label matched, a mis-binding never surfaces in the
|
|
128
|
+
// unmatched report. Sorted once here rather than once per label.
|
|
129
|
+
var ordered = mapping.OrderByDescending(e => e.Key.Length).ToList();
|
|
130
|
+
|
|
131
|
+
foreach (var label in labels)
|
|
132
|
+
{
|
|
133
|
+
// Read the current string from whichever family this component belongs to.
|
|
134
|
+
var current = label is Text legacy ? legacy.text : ((TMP_Text)label).text;
|
|
135
|
+
if (string.IsNullOrEmpty(current)) continue;
|
|
136
|
+
|
|
137
|
+
var matched = false;
|
|
138
|
+
foreach (var kvp in ordered)
|
|
139
|
+
{
|
|
140
|
+
if (!current.Contains(kvp.Key)) continue;
|
|
141
|
+
|
|
142
|
+
var lse = label.gameObject.GetComponent<LocalizeStringEvent>()
|
|
143
|
+
?? label.gameObject.AddComponent<LocalizeStringEvent>();
|
|
144
|
+
lse.StringReference = new UnityEngine.Localization.LocalizedString(table, kvp.Value);
|
|
145
|
+
|
|
146
|
+
// Wire the listener through the public UnityEventTools API. The persistent-call
|
|
147
|
+
// fields could be written directly through SerializedObject instead, but those
|
|
148
|
+
// are private serialized names with no compatibility guarantee, and it isn't
|
|
149
|
+
// necessary. A delegate to the component's public `text` setter, handed to
|
|
150
|
+
// AddPersistentListener, produces the same serialized call: target = the
|
|
151
|
+
// component, method = set_text, mode = EventDefined (dynamic).
|
|
152
|
+
//
|
|
153
|
+
// The setter has no C# method-group name, so the delegate is built by name.
|
|
154
|
+
// That is reflection over a *public* member, which is fine; reaching for the
|
|
155
|
+
// private m_* fields would not be. `set_text` is public on both Text and
|
|
156
|
+
// TMP_Text, so the same call works for either target.
|
|
157
|
+
var setText = (UnityAction<string>)System.Delegate.CreateDelegate(
|
|
158
|
+
typeof(UnityAction<string>), label, "set_text");
|
|
159
|
+
|
|
160
|
+
for (int i = lse.OnUpdateString.GetPersistentEventCount() - 1; i >= 0; i--)
|
|
161
|
+
{
|
|
162
|
+
UnityEventTools.RemovePersistentListener(lse.OnUpdateString, i);
|
|
163
|
+
}
|
|
164
|
+
UnityEventTools.AddPersistentListener(lse.OnUpdateString, setText);
|
|
165
|
+
|
|
166
|
+
// AddPersistentListener leaves the call at RuntimeOnly, which means the label does
|
|
167
|
+
// NOT update when the locale changes in the Editor: correct in a build, dormant
|
|
168
|
+
// while authoring, and it stays dormant through a save and reload. Set the state
|
|
169
|
+
// explicitly. SetPersistentListenerState is public API on UnityEventBase.
|
|
170
|
+
// Verified on Unity 6000.5.8f1: without this the listener never fires in Edit mode.
|
|
171
|
+
var callIndex = lse.OnUpdateString.GetPersistentEventCount() - 1;
|
|
172
|
+
lse.OnUpdateString.SetPersistentListenerState(
|
|
173
|
+
callIndex, UnityEventCallState.EditorAndRuntime);
|
|
174
|
+
|
|
175
|
+
EditorUtility.SetDirty(lse);
|
|
176
|
+
matched = true;
|
|
177
|
+
break;
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
// A label the mapping never covered is a coverage gap the caller has to see.
|
|
181
|
+
// Reporting "localized 12" while silently leaving 9 untouched is the failure mode
|
|
182
|
+
// this return value exists to prevent.
|
|
183
|
+
if (!matched)
|
|
184
|
+
{
|
|
185
|
+
unmatched.Add($"{scenePath} :: {label.gameObject.name} :: \"{current}\"");
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
return unmatched;
|
|
190
|
+
}
|
|
191
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
using UnityEngine;
|
|
2
|
+
using TMPro;
|
|
3
|
+
using UnityEngine.Localization;
|
|
4
|
+
using UnityEngine.Localization.Components;
|
|
5
|
+
|
|
6
|
+
/// <summary>
|
|
7
|
+
/// Swaps a TMP_Text font based on the active locale using an Asset Table.
|
|
8
|
+
/// Add to any GameObject with a TMP_Text that needs locale-specific fonts (e.g., CJK).
|
|
9
|
+
/// </summary>
|
|
10
|
+
[AddComponentMenu("Localization/Asset/Localized Font Asset")]
|
|
11
|
+
public class LocalizedFontAsset : LocalizedAssetBehaviour<TMP_FontAsset, LocalizedTmpFont>
|
|
12
|
+
{
|
|
13
|
+
protected override void UpdateAsset(TMP_FontAsset font)
|
|
14
|
+
{
|
|
15
|
+
var tmp = GetComponent<TMP_Text>();
|
|
16
|
+
if (tmp != null) tmp.font = font;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: manage-sprite-atlas
|
|
3
|
+
description: Manages SpriteAtlas assets through a prebuild pipeline, covering master and variant atlases, packing settings, and platform overrides. Use when asked to create or optimize sprite atlases.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Unity SpriteAtlas V2
|
|
7
|
+
|
|
8
|
+
Provides *editor-safe* procedural knowledge for scripting atlases in Unity projects. **V2 enforces strict separation between editor authoring and runtime access.**
|
|
9
|
+
|
|
10
|
+
> ⚠ **Critical V2 Principle**: `SpriteAtlas` is **runtime-only**. `SpriteAtlasAsset` is **editor-only**. Never mix contexts. Always use V2.
|
|
11
|
+
|
|
12
|
+
## 🚨 CRITICAL: Required Checks and User Inputs Before Implementation
|
|
13
|
+
|
|
14
|
+
**ALWAYS perform these checks and ask these questions BEFORE generating any code:**
|
|
15
|
+
|
|
16
|
+
### Read the shipped resources before writing code (REQUIRED)
|
|
17
|
+
|
|
18
|
+
This skill ships working C# under `resources/`, and the atlas code that goes wrong is almost always
|
|
19
|
+
code written without reading it first. Open the files for the path you are taking, then write.
|
|
20
|
+
|
|
21
|
+
| Taking this path | Read first |
|
|
22
|
+
|---|---|
|
|
23
|
+
| Any atlas work at all | [resources/authoringvsruntime.cs](resources/authoringvsruntime.cs), [references/common-errors.md](references/common-errors.md) |
|
|
24
|
+
| Prebuild generation (the default) | [resources/spriteatlasprebuildgenerator.cs](resources/spriteatlasprebuildgenerator.cs), [resources/enablespritepacking.cs](resources/enablespritepacking.cs), [resources/savespriteatlasasset.cs](resources/savespriteatlasasset.cs) |
|
|
25
|
+
| Option B, Addressables late-binding | [resources/buildaddressablespostprocess.cs](resources/buildaddressablespostprocess.cs), [resources/spriteatlaslatebinding.cs](resources/spriteatlaslatebinding.cs), [resources/handlelatebinding.cs](resources/handlelatebinding.cs) |
|
|
26
|
+
| Anything that might use an older API | [resources/deprecatedmethods.cs](resources/deprecatedmethods.cs), [resources/dontscriptspriteatlasineditor.cs](resources/dontscriptspriteatlasineditor.cs), [resources/dontpackinruntimebuilds.cs](resources/dontpackinruntimebuilds.cs) |
|
|
27
|
+
|
|
28
|
+
`resources/` holds 38 files in all, covering custom packers, variants, platform settings, and
|
|
29
|
+
runtime access. Browse the directory when your task is not in the table above rather than inventing
|
|
30
|
+
an approach. Reaching for the API from memory instead of reading these is the single most common
|
|
31
|
+
cause of an atlas that imports cleanly and then does nothing at runtime.
|
|
32
|
+
|
|
33
|
+
### 0. Check for Existing Scripts (REQUIRED FIRST STEP)
|
|
34
|
+
|
|
35
|
+
**BEFORE generating any code, scan the project for existing SpriteAtlas scripts generated by this skill.**
|
|
36
|
+
|
|
37
|
+
Search for files containing the identifier: `// [UNITY-SKILL:SPRITEATLAS]`
|
|
38
|
+
|
|
39
|
+
**If existing scripts are found, ALWAYS ask the user with this format:**
|
|
40
|
+
|
|
41
|
+
> "I found existing SpriteAtlas scripts in your project:
|
|
42
|
+
>
|
|
43
|
+
> **Prebuild Generator:**
|
|
44
|
+
> - `Assets/Editor/SpriteAtlas/SpriteAtlasPrebuildGenerator.cs`
|
|
45
|
+
>
|
|
46
|
+
> **Addressables Builder:**
|
|
47
|
+
> - `Assets/Editor/SpriteAtlas/BuildAddressablesPostprocess.cs`
|
|
48
|
+
>
|
|
49
|
+
> **Runtime Loader:**
|
|
50
|
+
> - `Assets/Scripts/SpriteAtlas/SpriteAtlasLateBinding.cs`
|
|
51
|
+
>
|
|
52
|
+
> What would you like to do?"
|
|
53
|
+
|
|
54
|
+
**Then present options:**
|
|
55
|
+
|
|
56
|
+
- **Option A: Update existing scripts** (Recommended if requirements changed)
|
|
57
|
+
- Regenerates scripts at existing paths
|
|
58
|
+
- Preserves file locations
|
|
59
|
+
- Updates to latest version
|
|
60
|
+
- ⚠ May overwrite custom modifications
|
|
61
|
+
|
|
62
|
+
- **Option B: Create new scripts with different names**
|
|
63
|
+
- Generates alongside existing scripts
|
|
64
|
+
- Allows multiple atlas configurations
|
|
65
|
+
- Original scripts remain unchanged
|
|
66
|
+
- You'll need to specify new names/paths
|
|
67
|
+
|
|
68
|
+
- **Option C: Abort (keep existing unchanged)**
|
|
69
|
+
- No code generation
|
|
70
|
+
- No changes to project
|
|
71
|
+
- Use this if you want to keep current setup
|
|
72
|
+
|
|
73
|
+
**User Choice Handling:**
|
|
74
|
+
|
|
75
|
+
- **If A chosen**: Regenerate at existing paths, increment version to 2.0.1+
|
|
76
|
+
- **If B chosen**: Ask for new script names (e.g., "SpriteAtlasPrebuild_Custom.cs"), then generate
|
|
77
|
+
- **If C chosen**: Stop immediately, inform user no changes were made
|
|
78
|
+
|
|
79
|
+
### 1. Delivery Mechanism (REQUIRED)
|
|
80
|
+
|
|
81
|
+
Before generating code, ask "How do you want to deliver the sprite atlases?" and read [delivery-mechanism.md](references/delivery-mechanism.md) to compare the two answers. It covers Built-in data against Addressables late-binding, with the trade-offs and the use cases that fit each.
|
|
82
|
+
|
|
83
|
+
### 2. SpritePacker Mode (REQUIRED)
|
|
84
|
+
|
|
85
|
+
**Enable Sprite Packer mode before creating atlases, then read the setting back and confirm it took.**
|
|
86
|
+
Use the code in [resources/enablespritepacking.cs](resources/enablespritepacking.cs); it sets
|
|
87
|
+
`EditorSettings.spritePackerMode` and configures the importer's packing settings.
|
|
88
|
+
|
|
89
|
+
This is the step that decides whether the atlas you produce is real. `Disabled` is the zero value of
|
|
90
|
+
`SpritePackerMode`, so any project where nobody has set it carries packing **Disabled**, and an atlas
|
|
91
|
+
created while it is Disabled still imports, still shows up as an asset, and still looks finished, but
|
|
92
|
+
can never pack. Unity says so in the Inspector: *"Sprite Atlas packing is disabled"*. Nothing else in
|
|
93
|
+
the workflow fails, so an atlas shipped this way reads as a success. Do not assume a project is
|
|
94
|
+
already configured: read the value.
|
|
95
|
+
|
|
96
|
+
So do not treat "I set it" as done. After setting it, read `EditorSettings.spritePackerMode` back,
|
|
97
|
+
confirm it is **not** `Disabled`, and report the value you actually read. If you cannot read it back,
|
|
98
|
+
say so rather than assuming the write landed.
|
|
99
|
+
|
|
100
|
+
**DO NOT edit meta files DIRECTLY.**
|
|
101
|
+
|
|
102
|
+
## 🚨 CRITICAL: Default Approach is Prebuild Generation
|
|
103
|
+
|
|
104
|
+
**ALWAYS use `IPreprocessBuildWithReport` to automatically generate or update SpriteAtlases during the build pipeline.** This is the DEFAULT and REQUIRED approach unless the user EXPLICITLY requests manual authoring.
|
|
105
|
+
|
|
106
|
+
### ❌ DO NOT Create Manual Menu Item Scripts
|
|
107
|
+
|
|
108
|
+
**NEVER create scripts with `[MenuItem]` attributes for atlas generation unless explicitly requested.** The prebuild approach eliminates the need for manual clicks. **Only use manual authoring for**: Hand-optimized layouts, specific sprite arrangements, or editor preview requirements. See [Advanced: Manual Authoring](#advanced-manual-authoring).
|
|
109
|
+
|
|
110
|
+
## 🚨 CRITICAL: Sprite Source Location Restriction
|
|
111
|
+
|
|
112
|
+
**ONLY add sprites from the project's Assets folder. NEVER add sprites from Unity built-in assets, packages, or external locations.** Unity built-in assets cannot be packed into SpriteAtlas, and package assets may cause import/dependency issues.
|
|
113
|
+
|
|
114
|
+
## Critical V2 Architecture
|
|
115
|
+
|
|
116
|
+
Read [v2-architecture.md](references/v2-architecture.md) before writing any atlas code, so editor authoring and runtime access stay in their own contexts. It gives the component-per-context table and the invalid-to-correct pairs behind most cross-context errors.
|
|
117
|
+
|
|
118
|
+
## Core V2 Workflow (Reference Only - Use Prebuild Instead)
|
|
119
|
+
|
|
120
|
+
> 🚨 **IMPORTANT**: This workflow is shown for reference only. **ALWAYS implement this inside `IPreprocessBuildWithReport.OnPreprocessBuild()`** rather than in manual scripts. See [Quick Start](#quick-start-automated-prebuild-generation-default-approach).
|
|
121
|
+
|
|
122
|
+
## Prerequisites
|
|
123
|
+
|
|
124
|
+
- Unity 6000.3 or later
|
|
125
|
+
- Basic understanding of Unity's asset import pipeline
|
|
126
|
+
- Familiarity with editor scripting for atlas authoring
|
|
127
|
+
|
|
128
|
+
## Quick Start: Automated Prebuild Generation (DEFAULT APPROACH)
|
|
129
|
+
|
|
130
|
+
### Overview
|
|
131
|
+
|
|
132
|
+
**This is the PRIMARY and DEFAULT way to create SpriteAtlases.** Implement `IPreprocessBuildWithReport` to automatically generate or update SpriteAtlases before each build based on categorization rules. No manual menu clicks required.
|
|
133
|
+
|
|
134
|
+
### Workflow Steps
|
|
135
|
+
|
|
136
|
+
**Step 1: Ask User for Delivery Mechanism**
|
|
137
|
+
|
|
138
|
+
Before generating code, ask: "How do you want to deliver the sprite atlases: (A) Built-in data or (B) Late-binding via Addressables?"
|
|
139
|
+
|
|
140
|
+
**Step 2: Create Prebuild Script**
|
|
141
|
+
|
|
142
|
+
Create this script in an Editor folder. Customize based on user's delivery choice:
|
|
143
|
+
|
|
144
|
+
### Option A: Built-in Data (Immediate Loading)
|
|
145
|
+
|
|
146
|
+
Built-in Data (Immediate Loading)
|
|
147
|
+
|
|
148
|
+
### Option B: Late-Binding via Addressables (On-Demand Loading)
|
|
149
|
+
|
|
150
|
+
> 🚨 **CRITICAL ENFORCEMENT**: When user chooses Addressables, you MUST generate ALL THREE scripts below. Never generate just one or two - all three are required for Addressables delivery to work.
|
|
151
|
+
|
|
152
|
+
**Required Scripts (ALL THREE MANDATORY):**
|
|
153
|
+
|
|
154
|
+
1. **Prebuild script** (IPreprocessBuildWithReport) - Generates atlases, creates Addressables entries
|
|
155
|
+
2. **Build Addressables script** (IPostprocessBuildWithReport) - Builds Addressables content bundles
|
|
156
|
+
3. **Late-binding runtime loader** (MonoBehaviour) - Handles on-demand loading at runtime
|
|
157
|
+
|
|
158
|
+
See [references/addressables-delivery.md](references/addressables-delivery.md) for complete implementation.
|
|
159
|
+
|
|
160
|
+
#### Complete Workflow
|
|
161
|
+
|
|
162
|
+
Read [complete-workflow.md](references/complete-workflow.md) for the end-to-end flow, including the categorization rules and build steps that follow it. It traces the branch from the existing-script check through the Option A or Option B script set.
|
|
163
|
+
|
|
164
|
+
### Common Categorization Patterns
|
|
165
|
+
|
|
166
|
+
**By Folder Structure:**
|
|
167
|
+
```csharp
|
|
168
|
+
GenerateAtlasByFolder("Assets/Art/UI/Buttons", "Assets/Atlases/UI_Buttons.spriteatlasv2");
|
|
169
|
+
GenerateAtlasByFolder("Assets/Art/UI/Icons", "Assets/Atlases/UI_Icons.spriteatlasv2");
|
|
170
|
+
GenerateAtlasByFolder("Assets/Art/Characters/Player", "Assets/Atlases/Player.spriteatlasv2");
|
|
171
|
+
```
|
|
172
|
+
|
|
173
|
+
**By Naming Convention:**
|
|
174
|
+
```csharp
|
|
175
|
+
GenerateAtlasByNaming("Assets/Art", "icon_", "Assets/Atlases/Icons.spriteatlasv2");
|
|
176
|
+
GenerateAtlasByNaming("Assets/Art", "bg_", "Assets/Atlases/Backgrounds.spriteatlasv2");
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
### Variant Generation in Prebuild
|
|
180
|
+
|
|
181
|
+
Generate variant atlases for different resolutions.
|
|
182
|
+
|
|
183
|
+
## Advanced: Manual Authoring (NOT Default - Use Only When Explicitly Requested)
|
|
184
|
+
|
|
185
|
+
Read [advanced-manual-authoring.md](references/advanced-manual-authoring.md) only when the user explicitly asks for manual control, custom sprite ordering, or an editor preview. It lists when manual authoring applies and when it does not, then points at the full patterns.
|
|
186
|
+
|
|
187
|
+
## Key Requirements (V2-Specific)
|
|
188
|
+
|
|
189
|
+
Read [key-requirements.md](references/key-requirements.md) before writing atlas code and again before declaring the work done. It is the V2 checklist, covering script tagging, `includeInBuild`, the two-step importer pattern, `.spriteatlasv2`, and platform formats.
|
|
190
|
+
|
|
191
|
+
## Detailed Reference
|
|
192
|
+
|
|
193
|
+
- **Addressables Delivery**: [references/addressables-delivery.md](references/addressables-delivery.md) - Complete late-binding setup with Addressables
|
|
194
|
+
- **Manual Authoring**: [references/manual-authoring.md](references/manual-authoring.md) - Manual patterns (NOT default - use only when explicitly requested)
|
|
195
|
+
- **Common Errors**: [references/common-errors.md](references/common-errors.md) - Invalid patterns and API corrections
|
|
196
|
+
- **API Reference**: [references/api.md](references/api.md) - Complete V2 class documentation
|
|
197
|
+
- **Custom Packing**: [references/custom-packing.md](references/custom-packing.md) - `ScriptablePacker` implementation
|
|
198
|
+
- **Best Practices**: [references/best-practices.md](references/best-practices.md) - Optimization and common pitfalls
|
|
199
|
+
|
|
200
|
+
## Namespaces
|
|
201
|
+
|
|
202
|
+
Read [namespaces.md](references/namespaces.md) when a type does not resolve, because `UnityEditor.U2D` and `UnityEngine.U2D` hold different V2 types. It gives the exact `using` blocks for editor and runtime scripts.
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
# Late-Binding via Addressables (On-Demand Loading)
|
|
2
|
+
|
|
3
|
+
This approach creates SpriteAtlases that are NOT included in the build and are instead loaded on-demand via the Addressables system.
|
|
4
|
+
|
|
5
|
+
## When to Use
|
|
6
|
+
|
|
7
|
+
- DLC content, optional features, large assets, downloadable content
|
|
8
|
+
- Level-specific sprites (100+ levels)
|
|
9
|
+
- Localized UI sprites (multiple languages)
|
|
10
|
+
- Character skins or cosmetics
|
|
11
|
+
- Any content that can be loaded asynchronously
|
|
12
|
+
|
|
13
|
+
## Prerequisites
|
|
14
|
+
|
|
15
|
+
1. Install Addressables package: `com.unity.addressables`
|
|
16
|
+
2. Initialize Addressables in your project (Window > Asset Management > Addressables > Groups)
|
|
17
|
+
|
|
18
|
+
## 🚨 REQUIRED: Three Scripts for Addressables Delivery
|
|
19
|
+
|
|
20
|
+
When using Addressables, you MUST create all three scripts:
|
|
21
|
+
|
|
22
|
+
1. **Prebuild Script** - Generates atlases and creates Addressables entries (IPreprocessBuildWithReport)
|
|
23
|
+
2. **Build Addressables Script** - Builds Addressables content as build step (IPostprocessBuildWithReport)
|
|
24
|
+
3. **Late-Binding Runtime Loader** - Loads atlases at runtime via SpriteAtlasManager
|
|
25
|
+
|
|
26
|
+
## Script 1: Prebuild Atlas Generator with Addressables
|
|
27
|
+
|
|
28
|
+
See [resources/spriteatlasprebuildgenerator.cs](../resources/spriteatlasprebuildgenerator.cs).
|
|
29
|
+
|
|
30
|
+
## Script 2: Build Addressables Content (REQUIRED)
|
|
31
|
+
|
|
32
|
+
This script runs AFTER atlas generation to build the Addressables content bundle.
|
|
33
|
+
|
|
34
|
+
See [resources/buildaddressablespostprocess.cs](../resources/buildaddressablespostprocess.cs).
|
|
35
|
+
|
|
36
|
+
## Script 3: Late-Binding Runtime Loader (REQUIRED)
|
|
37
|
+
|
|
38
|
+
This script handles automatic on-demand loading of atlases via SpriteAtlasManager callbacks.
|
|
39
|
+
|
|
40
|
+
See [resources/spriteatlaslatebinding.cs](../resources/spriteatlaslatebinding.cs).
|
|
41
|
+
|
|
42
|
+
## Setup Instructions
|
|
43
|
+
|
|
44
|
+
1. **Create all three scripts** in your Editor folder (Scripts 1 & 2) and runtime folder (Script 3)
|
|
45
|
+
2. **Add SpriteAtlasLateBinding to scene**: Attach to a persistent GameObject in your first scene
|
|
46
|
+
3. **Build your project**: Atlases will be generated, addressables will be built automatically
|
|
47
|
+
4. **Runtime**: Sprites automatically trigger atlas loading on first access
|
|
48
|
+
|
|
49
|
+
## Key Points
|
|
50
|
+
|
|
51
|
+
1. **🚨 All three scripts are REQUIRED** - Missing any will break Addressables delivery
|
|
52
|
+
2. **includeInBuild = false**: This is critical for Addressables delivery
|
|
53
|
+
3. **Automatic Addressables setup**: The prebuild script creates addressable entries automatically
|
|
54
|
+
4. **Build Addressables as postprocess step**: Script 2 ensures content bundles are built
|
|
55
|
+
5. **Late-binding via SpriteAtlasManager**: Script 3 handles on-demand loading automatically
|
|
56
|
+
6. **Address naming**: Uses the atlas filename as the address (e.g., "UI_Atlas")
|
|
57
|
+
7. **Async loading**: Runtime loading is asynchronous and automatic
|
|
58
|
+
8. **Resource management**: Handles automatically release all atlases on destroy
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# Advanced: Manual Authoring (NOT Default - Use Only When Explicitly Requested)
|
|
2
|
+
|
|
3
|
+
> ⚠ **WARNING**: Manual authoring is NOT the default approach. Only use these patterns when the user EXPLICITLY requests manual control or editor preview during development.
|
|
4
|
+
|
|
5
|
+
> 🚨 **DEFAULT APPROACH**: Use prebuild generation with `IPreprocessBuildWithReport` instead. See [Quick Start](../SKILL.md#quick-start-automated-prebuild-generation-default-approach).
|
|
6
|
+
|
|
7
|
+
**Manual authoring is appropriate ONLY for:**
|
|
8
|
+
- Hand-optimized sprite layouts where exact positioning matters
|
|
9
|
+
- Custom sprite ordering requirements
|
|
10
|
+
- Editor preview during authoring workflow
|
|
11
|
+
- Explicitly requested by user
|
|
12
|
+
|
|
13
|
+
**DO NOT use manual authoring when:**
|
|
14
|
+
- User asks to "create sprite atlas" (use prebuild)
|
|
15
|
+
- User asks to "optimize sprites" (use prebuild)
|
|
16
|
+
- User asks for automated workflow (use prebuild)
|
|
17
|
+
- No specific manual control requirement mentioned
|
|
18
|
+
|
|
19
|
+
For complete manual authoring patterns including master atlas creation, variant creation, and runtime loading, see [references/manual-authoring.md](manual-authoring.md).
|