@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,145 @@
|
|
|
1
|
+
// [UNITY-SKILL:SPRITEATLAS]
|
|
2
|
+
using UnityEngine;
|
|
3
|
+
using UnityEngine.U2D;
|
|
4
|
+
using System.Collections.Generic;
|
|
5
|
+
|
|
6
|
+
/// <summary>
|
|
7
|
+
/// Demonstrates caching loaded SpriteAtlases for efficient reuse.
|
|
8
|
+
/// Avoid reloading the same atlas multiple times by caching loaded instances.
|
|
9
|
+
/// </summary>
|
|
10
|
+
public class CacheLoadedAtlases : MonoBehaviour
|
|
11
|
+
{
|
|
12
|
+
/// <summary>Cached dictionary of loaded atlases</summary>
|
|
13
|
+
private readonly Dictionary<string, SpriteAtlas> _loadedAtlases = new Dictionary<string, SpriteAtlas>();
|
|
14
|
+
|
|
15
|
+
/// <summary>Reference to SpriteAtlasManager for loading</summary>
|
|
16
|
+
private SpriteAtlasManager _atlasManager;
|
|
17
|
+
|
|
18
|
+
private void Awake()
|
|
19
|
+
{
|
|
20
|
+
RegisterCallbacks();
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
private void OnDestroy()
|
|
24
|
+
{
|
|
25
|
+
UnregisterCallbacks();
|
|
26
|
+
ClearCache();
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
private void RegisterCallbacks()
|
|
30
|
+
{
|
|
31
|
+
SpriteAtlasManager.atlasRegistered += OnAtlasLoaded;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
private void UnregisterCallbacks()
|
|
35
|
+
{
|
|
36
|
+
SpriteAtlasManager.atlasRegistered -= OnAtlasLoaded;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/// <summary>
|
|
40
|
+
/// Gets an atlas by name, loading it if not already cached.
|
|
41
|
+
/// Returns true if the atlas was found (cached or newly loaded).
|
|
42
|
+
/// </summary>
|
|
43
|
+
public bool GetAtlas(string atlasName, out SpriteAtlas atlas)
|
|
44
|
+
{
|
|
45
|
+
// Check cache first
|
|
46
|
+
if (_loadedAtlases.TryGetValue(atlasName, out atlas))
|
|
47
|
+
{
|
|
48
|
+
return true;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
// Not cached - load it
|
|
52
|
+
return LoadAndCacheAtlas(atlasName);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
/// <summary>
|
|
56
|
+
/// Loads an atlas and adds it to the cache.
|
|
57
|
+
/// </summary>
|
|
58
|
+
private bool LoadAndCacheAtlas(string atlasName)
|
|
59
|
+
{
|
|
60
|
+
// Example: Load from Resources (not recommended for production)
|
|
61
|
+
// SpriteAtlas atlas = Resources.Load<SpriteAtlas>($"Atlases/{atlasName}");
|
|
62
|
+
|
|
63
|
+
// For production, use Addressables or AssetBundle loading
|
|
64
|
+
// SpriteAtlas atlas = await Addressables.LoadAssetAsync<SpriteAtlas>($"Atlases/{atlasName}").Task;
|
|
65
|
+
|
|
66
|
+
Debug.Log($"Loading and caching atlas: {atlasName}");
|
|
67
|
+
|
|
68
|
+
// Placeholder - replace with actual loading logic
|
|
69
|
+
SpriteAtlas atlas = null; // Replace with actual loaded atlas
|
|
70
|
+
|
|
71
|
+
if (atlas != null)
|
|
72
|
+
{
|
|
73
|
+
_loadedAtlases[atlasName] = atlas;
|
|
74
|
+
return true;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
return false;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
/// <summary>
|
|
81
|
+
/// Gets a cached atlas without attempting to load it.
|
|
82
|
+
/// Returns false if not found in cache.
|
|
83
|
+
/// </summary>
|
|
84
|
+
public bool TryGetCachedAtlas(string atlasName, out SpriteAtlas atlas)
|
|
85
|
+
{
|
|
86
|
+
return _loadedAtlases.TryGetValue(atlasName, out atlas);
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
/// <summary>
|
|
90
|
+
/// Checks if an atlas is currently cached.
|
|
91
|
+
/// </summary>
|
|
92
|
+
public bool IsAtlasCached(string atlasName)
|
|
93
|
+
{
|
|
94
|
+
return _loadedAtlases.ContainsKey(atlasName);
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
/// <summary>
|
|
98
|
+
/// Removes an atlas from the cache without destroying it.
|
|
99
|
+
/// The atlas can still be used, but will need to be reloaded if requested again.
|
|
100
|
+
/// </summary>
|
|
101
|
+
public bool RemoveFromCache(string atlasName)
|
|
102
|
+
{
|
|
103
|
+
return _loadedAtlases.Remove(atlasName);
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
/// <summary>
|
|
107
|
+
/// Clears all cached atlases.
|
|
108
|
+
/// Use this when switching scenes or cleaning up.
|
|
109
|
+
/// </summary>
|
|
110
|
+
public void ClearCache()
|
|
111
|
+
{
|
|
112
|
+
_loadedAtlases.Clear();
|
|
113
|
+
Debug.Log("Atlas cache cleared");
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
/// <summary>
|
|
117
|
+
/// Gets the number of atlases currently in the cache.
|
|
118
|
+
/// </summary>
|
|
119
|
+
public int CachedAtlasCount => _loadedAtlases.Count;
|
|
120
|
+
|
|
121
|
+
/// <summary>
|
|
122
|
+
/// Logs all cached atlas names.
|
|
123
|
+
/// </summary>
|
|
124
|
+
public void LogCachedAtlases()
|
|
125
|
+
{
|
|
126
|
+
Debug.Log("Cached atlases:");
|
|
127
|
+
foreach (var kvp in _loadedAtlases)
|
|
128
|
+
{
|
|
129
|
+
Debug.Log($" - {kvp.Key}");
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
/// <summary>
|
|
134
|
+
/// Callback when an atlas is loaded by SpriteAtlasManager.
|
|
135
|
+
/// Adds the loaded atlas to our cache for future use.
|
|
136
|
+
/// </summary>
|
|
137
|
+
private void OnAtlasLoaded(SpriteAtlas atlas)
|
|
138
|
+
{
|
|
139
|
+
if (atlas != null && !_loadedAtlases.ContainsKey(atlas.name))
|
|
140
|
+
{
|
|
141
|
+
_loadedAtlases[atlas.name] = atlas;
|
|
142
|
+
Debug.Log($"Atlas cached: {atlas.name}");
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
}
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
// [UNITY-SKILL:SPRITEATLAS]
|
|
2
|
+
using UnityEditor;
|
|
3
|
+
using UnityEditor.U2D;
|
|
4
|
+
using UnityEngine;
|
|
5
|
+
|
|
6
|
+
/// <summary>
|
|
7
|
+
/// Demonstrates proper cleanup after batch operations on SpriteAtlases.
|
|
8
|
+
/// Always use try/finally blocks to ensure cleanup happens even on errors.
|
|
9
|
+
/// </summary>
|
|
10
|
+
public static class CleanupBatchOperationsExample
|
|
11
|
+
{
|
|
12
|
+
/// <summary>
|
|
13
|
+
/// Creates multiple atlases in a batch with proper cleanup.
|
|
14
|
+
/// Uses try/finally to ensure AssetDatabase.ImportAsset is called for each atlas.
|
|
15
|
+
/// </summary>
|
|
16
|
+
public static void BatchCreateAtlases()
|
|
17
|
+
{
|
|
18
|
+
var atlasConfigs = new[]
|
|
19
|
+
{
|
|
20
|
+
new { Folder = "Assets/Sprites/UI", Output = "Assets/Atlases/UI.spriteatlasv2" },
|
|
21
|
+
new { Folder = "Assets/Sprites/Characters", Output = "Assets/Atlases/Characters.spriteatlasv2" },
|
|
22
|
+
new { Folder = "Assets/Sprites/Items", Output = "Assets/Atlases/Items.spriteatlasv2" }
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
for (int i = 0; i < atlasConfigs.Length; i++)
|
|
26
|
+
{
|
|
27
|
+
try
|
|
28
|
+
{
|
|
29
|
+
CreateAtlasFromFolder(atlasConfigs[i].Folder, atlasConfigs[i].Output);
|
|
30
|
+
}
|
|
31
|
+
catch (System.Exception ex)
|
|
32
|
+
{
|
|
33
|
+
Debug.LogError($"Failed to create atlas {atlasConfigs[i].Output}: {ex.Message}");
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
// Final cleanup - refresh asset database
|
|
38
|
+
AssetDatabase.Refresh();
|
|
39
|
+
Debug.Log("Batch atlas creation completed");
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/// <summary>
|
|
43
|
+
/// Creates an atlas from a folder and configures it.
|
|
44
|
+
/// </summary>
|
|
45
|
+
private static void CreateAtlasFromFolder(string folderPath, string outputPath)
|
|
46
|
+
{
|
|
47
|
+
// Find sprites in folder
|
|
48
|
+
string[] guids = AssetDatabase.FindAssets("t:Sprite", new[] { folderPath });
|
|
49
|
+
|
|
50
|
+
Object[] sprites = new Object[guids.Length];
|
|
51
|
+
for (int i = 0; i < guids.Length; i++)
|
|
52
|
+
{
|
|
53
|
+
sprites[i] = AssetDatabase.LoadAssetAtPath<Sprite>(
|
|
54
|
+
AssetDatabase.GUIDToAssetPath(guids[i])
|
|
55
|
+
);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
// Create and save atlas
|
|
59
|
+
SpriteAtlasAsset atlasAsset = new SpriteAtlasAsset();
|
|
60
|
+
atlasAsset.Add(sprites);
|
|
61
|
+
SpriteAtlasAsset.Save(atlasAsset, outputPath);
|
|
62
|
+
|
|
63
|
+
// Import and configure via importer
|
|
64
|
+
AssetDatabase.ImportAsset(outputPath);
|
|
65
|
+
|
|
66
|
+
SpriteAtlasImporter importer = AssetImporter.GetAtPath(outputPath) as SpriteAtlasImporter;
|
|
67
|
+
if (importer != null)
|
|
68
|
+
{
|
|
69
|
+
importer.includeInBuild = true;
|
|
70
|
+
var packingSettings = importer.packingSettings;
|
|
71
|
+
packingSettings.enableTightPacking = true;
|
|
72
|
+
importer.packingSettings = packingSettings;
|
|
73
|
+
importer.SaveAndReimport();
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
/// <summary>
|
|
78
|
+
/// Processes multiple atlases with progress bar and proper cleanup.
|
|
79
|
+
/// </summary>
|
|
80
|
+
public static void ProcessAtlasesWithProgress(string[] atlasPaths)
|
|
81
|
+
{
|
|
82
|
+
for (int i = 0; i < atlasPaths.Length; i++)
|
|
83
|
+
{
|
|
84
|
+
string path = atlasPaths[i];
|
|
85
|
+
float progress = (float)i / atlasPaths.Length;
|
|
86
|
+
|
|
87
|
+
if (EditorUtility.DisplayCancelableProgressBar(
|
|
88
|
+
"Processing Atlases",
|
|
89
|
+
$"Processing: {path}",
|
|
90
|
+
progress))
|
|
91
|
+
{
|
|
92
|
+
break; // User cancelled
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
try
|
|
96
|
+
{
|
|
97
|
+
ProcessSingleAtlas(path);
|
|
98
|
+
}
|
|
99
|
+
finally
|
|
100
|
+
{
|
|
101
|
+
// Ensure progress bar is cleared even on error
|
|
102
|
+
EditorUtility.ClearProgressBar();
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
/// <summary>
|
|
108
|
+
/// Processes a single atlas.
|
|
109
|
+
/// </summary>
|
|
110
|
+
private static void ProcessSingleAtlas(string path)
|
|
111
|
+
{
|
|
112
|
+
SpriteAtlasImporter importer = AssetImporter.GetAtPath(path) as SpriteAtlasImporter;
|
|
113
|
+
if (importer != null)
|
|
114
|
+
{
|
|
115
|
+
// Reimport to update
|
|
116
|
+
importer.SaveAndReimport();
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
using System;
|
|
2
|
+
using UnityEditor;
|
|
3
|
+
using UnityEditor.U2D;
|
|
4
|
+
using UnityEngine;
|
|
5
|
+
using UnityEngine.U2D;
|
|
6
|
+
using Object = UnityEngine.Object;
|
|
7
|
+
|
|
8
|
+
public static class MasterAtlasCreator
|
|
9
|
+
{
|
|
10
|
+
public static void CreateMasterAtlas(string path, Object[] spritesOrFolders)
|
|
11
|
+
{
|
|
12
|
+
// CRITICAL: Validate all sprites are from Assets/ folder before calling this
|
|
13
|
+
// Use: sprites.All(s => AssetDatabase.GetAssetPath(s).StartsWith("Assets/"))
|
|
14
|
+
|
|
15
|
+
// Step 1: Author content (editor-only)
|
|
16
|
+
SpriteAtlasAsset atlasAsset = new SpriteAtlasAsset();
|
|
17
|
+
atlasAsset.Add(spritesOrFolders); // Add sprites/folders - ONLY from Assets/ folder
|
|
18
|
+
SpriteAtlasAsset.Save(atlasAsset, path);
|
|
19
|
+
AssetDatabase.ImportAsset(path);
|
|
20
|
+
|
|
21
|
+
// Step 2: Configure via importer (editor-only)
|
|
22
|
+
SpriteAtlasImporter importer = AssetImporter.GetAtPath(path) as SpriteAtlasImporter;
|
|
23
|
+
if (importer == null) throw new InvalidOperationException("Failed to get SpriteAtlasImporter");
|
|
24
|
+
|
|
25
|
+
// Texture settings is a struct, so members cannot be edited directly.
|
|
26
|
+
var textureSettings = importer.textureSettings;
|
|
27
|
+
textureSettings.filterMode = FilterMode.Bilinear;
|
|
28
|
+
textureSettings.generateMipMaps = false;
|
|
29
|
+
importer.textureSettings = textureSettings;
|
|
30
|
+
|
|
31
|
+
// Packing settings is a struct, so members cannot be edited directly.
|
|
32
|
+
var packingSettings = importer.packingSettings;
|
|
33
|
+
packingSettings.padding = 4;
|
|
34
|
+
packingSettings.enableAlphaDilation = true;
|
|
35
|
+
importer.packingSettings = packingSettings;
|
|
36
|
+
|
|
37
|
+
// Platform settings (safe loop with type checks)
|
|
38
|
+
SetPlatformSettings(importer, "Android", TextureImporterFormat.ASTC_6x6); // Ensure format is valid.
|
|
39
|
+
SetPlatformSettings(importer, "iOS", TextureImporterFormat.ASTC_4x4); // [critical] TextureImporterPlatformSettings format type is TextureImporterFormat
|
|
40
|
+
|
|
41
|
+
// Mark for build inclusion
|
|
42
|
+
importer.includeInBuild = true;
|
|
43
|
+
importer.SaveAndReimport(); // REQUIRED
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
private static void SetPlatformSettings(SpriteAtlasImporter importer, string platformName, TextureImporterFormat format)
|
|
47
|
+
{
|
|
48
|
+
var settings = new TextureImporterPlatformSettings
|
|
49
|
+
{
|
|
50
|
+
name = platformName,
|
|
51
|
+
overridden = true,
|
|
52
|
+
maxTextureSize = 2048,
|
|
53
|
+
format = format // ✅ Direct enum assignment (no cast) - Unity stores internally as int but struct expects enum
|
|
54
|
+
};
|
|
55
|
+
importer.SetPlatformSettings(settings);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
// [UNITY-SKILL:SPRITEATLAS]
|
|
2
|
+
using UnityEditor;
|
|
3
|
+
using UnityEditor.U2D;
|
|
4
|
+
using UnityEngine;
|
|
5
|
+
|
|
6
|
+
/// <summary>
|
|
7
|
+
/// Utility class for creating atlases with custom packers.
|
|
8
|
+
/// Demonstrates how to assign a custom ScriptablePacker to a SpriteAtlasAsset.
|
|
9
|
+
/// </summary>
|
|
10
|
+
public static class CustomPackerSetup
|
|
11
|
+
{
|
|
12
|
+
/// <summary>
|
|
13
|
+
/// Creates an atlas with a custom grid packer using menu item.
|
|
14
|
+
/// Menu path: Tools/Create Atlas with Custom Packer
|
|
15
|
+
/// </summary>
|
|
16
|
+
[MenuItem("Tools/Create Atlas with Custom Packer")]
|
|
17
|
+
public static void CreateAtlasWithCustomPacker()
|
|
18
|
+
{
|
|
19
|
+
// Create atlas asset
|
|
20
|
+
SpriteAtlasAsset atlasAsset = new SpriteAtlasAsset();
|
|
21
|
+
|
|
22
|
+
// Add sprites from Assets/Sprites folder
|
|
23
|
+
string[] guids = AssetDatabase.FindAssets("t:Sprite", new[] { "Assets/Sprites" });
|
|
24
|
+
Object[] sprites = new Object[guids.Length];
|
|
25
|
+
for (int i = 0; i < guids.Length; i++)
|
|
26
|
+
{
|
|
27
|
+
sprites[i] = AssetDatabase.LoadAssetAtPath<Sprite>(
|
|
28
|
+
AssetDatabase.GUIDToAssetPath(guids[i])
|
|
29
|
+
);
|
|
30
|
+
}
|
|
31
|
+
atlasAsset.Add(sprites);
|
|
32
|
+
|
|
33
|
+
// Create custom packer instance
|
|
34
|
+
GridSpritePacker customPacker = ScriptableObject.CreateInstance<GridSpritePacker>();
|
|
35
|
+
customPacker.columns = 8;
|
|
36
|
+
customPacker.cellSize = 128;
|
|
37
|
+
customPacker.padding = 2;
|
|
38
|
+
|
|
39
|
+
// Assign custom packer to atlas
|
|
40
|
+
atlasAsset.SetScriptablePacker(customPacker);
|
|
41
|
+
|
|
42
|
+
// Save atlas to disk
|
|
43
|
+
string path = "Assets/CustomPackedAtlas.spriteatlas";
|
|
44
|
+
SpriteAtlasAsset.Save(atlasAsset, path);
|
|
45
|
+
AssetDatabase.ImportAsset(path);
|
|
46
|
+
|
|
47
|
+
// Configure via importer
|
|
48
|
+
SpriteAtlasImporter importer = AssetImporter.GetAtPath(path) as SpriteAtlasImporter;
|
|
49
|
+
importer.includeInBuild = true;
|
|
50
|
+
importer.SaveAndReimport();
|
|
51
|
+
|
|
52
|
+
Debug.Log($"Created atlas with custom packer at {path}");
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
/// <summary>
|
|
56
|
+
/// Creates an atlas with a size-optimized packer programmatically.
|
|
57
|
+
/// </summary>
|
|
58
|
+
public static void CreateSizeOptimizedAtlas()
|
|
59
|
+
{
|
|
60
|
+
SpriteAtlasAsset atlasAsset = new SpriteAtlasAsset();
|
|
61
|
+
|
|
62
|
+
// Add sprites...
|
|
63
|
+
string[] guids = AssetDatabase.FindAssets("t:Sprite", new[] { "Assets/Sprites" });
|
|
64
|
+
Object[] sprites = new Object[guids.Length];
|
|
65
|
+
for (int i = 0; i < guids.Length; i++)
|
|
66
|
+
{
|
|
67
|
+
sprites[i] = AssetDatabase.LoadAssetAtPath<Sprite>(
|
|
68
|
+
AssetDatabase.GUIDToAssetPath(guids[i])
|
|
69
|
+
);
|
|
70
|
+
}
|
|
71
|
+
atlasAsset.Add(sprites);
|
|
72
|
+
|
|
73
|
+
// Use size-optimized packer
|
|
74
|
+
SizeOptimizedPacker packer = ScriptableObject.CreateInstance<SizeOptimizedPacker>();
|
|
75
|
+
packer.atlasSize = 4096;
|
|
76
|
+
packer.padding = 4;
|
|
77
|
+
|
|
78
|
+
atlasAsset.SetScriptablePacker(packer);
|
|
79
|
+
|
|
80
|
+
string path = "Assets/OptimizedAtlas.spriteatlas";
|
|
81
|
+
SpriteAtlasAsset.Save(atlasAsset, path);
|
|
82
|
+
AssetDatabase.ImportAsset(path);
|
|
83
|
+
|
|
84
|
+
SpriteAtlasImporter importer = AssetImporter.GetAtPath(path) as SpriteAtlasImporter;
|
|
85
|
+
importer.includeInBuild = true;
|
|
86
|
+
importer.SaveAndReimport();
|
|
87
|
+
}
|
|
88
|
+
}
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
// [UNITY-SKILL:SPRITEATLAS]
|
|
2
|
+
using UnityEditor;
|
|
3
|
+
using UnityEditor.U2D;
|
|
4
|
+
|
|
5
|
+
/// <summary>
|
|
6
|
+
/// Documents deprecated SpriteAtlas methods and their replacements.
|
|
7
|
+
/// Always use the latest V2 API patterns.
|
|
8
|
+
/// </summary>
|
|
9
|
+
public static class DeprecatedMethodsDocumentation
|
|
10
|
+
{
|
|
11
|
+
/// <summary>
|
|
12
|
+
/// ⚠ DEPRECATED: SetBuildSettings method.
|
|
13
|
+
/// This method was used in early V1/V2 preview versions but is no longer available.
|
|
14
|
+
///
|
|
15
|
+
/// REPLACEMENT: Use SpriteAtlasImporter for all configuration settings.
|
|
16
|
+
/// </summary>
|
|
17
|
+
[System.Obsolete("SetBuildSettings is deprecated. Use SpriteAtlasImporter instead.")]
|
|
18
|
+
public static void Old_SetBuildSettings()
|
|
19
|
+
{
|
|
20
|
+
// OLD (deprecated):
|
|
21
|
+
// SpriteAtlasAsset atlas = new SpriteAtlasAsset();
|
|
22
|
+
// atlas.SetBuildSettings(settings);
|
|
23
|
+
|
|
24
|
+
// NEW:
|
|
25
|
+
// Create asset, save it, then configure via SpriteAtlasImporter
|
|
26
|
+
// SpriteAtlasImporter importer = AssetImporter.GetAtPath(path) as SpriteAtlasImporter;
|
|
27
|
+
// importer.packingSettings = settings;
|
|
28
|
+
// importer.SaveAndReimport();
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/// <summary>
|
|
32
|
+
/// ⚠ DEPRECATED: GetBuildSettings method.
|
|
33
|
+
/// Use SpriteAtlasImporter to read configuration instead.
|
|
34
|
+
/// </summary>
|
|
35
|
+
[System.Obsolete("GetBuildSettings is deprecated. Read from SpriteAtlasImporter instead.")]
|
|
36
|
+
public static void Old_GetBuildSettings()
|
|
37
|
+
{
|
|
38
|
+
// OLD (deprecated):
|
|
39
|
+
// var settings = atlas.GetBuildSettings();
|
|
40
|
+
|
|
41
|
+
// NEW:
|
|
42
|
+
// SpriteAtlasImporter importer = AssetImporter.GetAtPath(path) as SpriteAtlasImporter;
|
|
43
|
+
// var settings = importer.packingSettings;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
/// <summary>
|
|
47
|
+
/// ⚠ DEPRECATED: Direct modification of SpriteAtlas after creation.
|
|
48
|
+
/// In V2, SpriteAtlas is read-only at runtime and cannot be modified in editor.
|
|
49
|
+
///
|
|
50
|
+
/// REPLACEMENT: Modify SpriteAtlasAsset before saving, then reimport.
|
|
51
|
+
/// </summary>
|
|
52
|
+
[System.Obsolete("Direct SpriteAtlas modification is deprecated. Use SpriteAtlasAsset for editing.")]
|
|
53
|
+
public static void Old_DirectModification()
|
|
54
|
+
{
|
|
55
|
+
// OLD (deprecated):
|
|
56
|
+
// atlas.Add(sprites); // Not allowed in editor!
|
|
57
|
+
|
|
58
|
+
// NEW:
|
|
59
|
+
// SpriteAtlasAsset asset = new SpriteAtlasAsset();
|
|
60
|
+
// asset.Add(sprites);
|
|
61
|
+
// SpriteAtlasAsset.Save(asset, path);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
/// <summary>
|
|
65
|
+
/// ⚠ DEPRECATED: Using AssetDatabase.LoadAssetAtPath<SpriteAtlas>() in editor.
|
|
66
|
+
/// SpriteAtlas is runtime-only and cannot be loaded in editor context.
|
|
67
|
+
///
|
|
68
|
+
/// REPLACEMENT: Use SpriteAtlasAsset for editor operations.
|
|
69
|
+
/// </summary>
|
|
70
|
+
[System.Obsolete("Loading SpriteAtlas in editor is deprecated. Use SpriteAtlasAsset instead.")]
|
|
71
|
+
public static void Old_LoadSpriteAtlasInEditor()
|
|
72
|
+
{
|
|
73
|
+
// OLD (deprecated):
|
|
74
|
+
// SpriteAtlas atlas = AssetDatabase.LoadAssetAtPath<SpriteAtlas>(path);
|
|
75
|
+
|
|
76
|
+
// NEW:
|
|
77
|
+
// SpriteAtlasAsset asset = AssetDatabase.LoadAssetAtPath<SpriteAtlasAsset>(path);
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
/// <summary>
|
|
81
|
+
/// ⚠ DEPRECATED: Manual packing in editor using SpriteAtlasUtility.
|
|
82
|
+
/// SpriteAtlasUtility.PackAtlases() is for preview only, not build-time packing.
|
|
83
|
+
///
|
|
84
|
+
/// REPLACEMENT: Use the prebuild pipeline with IPreprocessBuildWithReport.
|
|
85
|
+
/// </summary>
|
|
86
|
+
[System.Obsolete("Manual packing is deprecated. Use IPreprocessBuildWithReport instead.")]
|
|
87
|
+
public static void Old_ManualPacking()
|
|
88
|
+
{
|
|
89
|
+
// OLD (deprecated):
|
|
90
|
+
// SpriteAtlasUtility.PackAtlases(atlases, BuildTarget.NoAPI);
|
|
91
|
+
|
|
92
|
+
// NEW:
|
|
93
|
+
// Implement IPreprocessBuildWithReport.OnPreprocessBuild() for automatic packing
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
/// <summary>
|
|
98
|
+
/// Migration guide: Old code patterns vs new V2 patterns.
|
|
99
|
+
/// </summary>
|
|
100
|
+
public static class MigrationGuide
|
|
101
|
+
{
|
|
102
|
+
/// <summary>
|
|
103
|
+
/// Pattern 1: Creating an atlas
|
|
104
|
+
/// </summary>
|
|
105
|
+
public static void CreateAtlas_Old()
|
|
106
|
+
{
|
|
107
|
+
// ❌ OLD (deprecated):
|
|
108
|
+
// var atlas = ScriptableObject.CreateInstance<SpriteAtlas>();
|
|
109
|
+
// AssetDatabase.AddObjectToAsset(atlas, path);
|
|
110
|
+
// EditorUtility.SetDirty(atlas);
|
|
111
|
+
|
|
112
|
+
// ✅ NEW (V2):
|
|
113
|
+
SpriteAtlasAsset asset = new SpriteAtlasAsset();
|
|
114
|
+
// Add sprites...
|
|
115
|
+
SpriteAtlasAsset.Save(asset, "Assets/MyAtlas.spriteatlasv2");
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
/// <summary>
|
|
119
|
+
/// Pattern 2: Configuring an atlas
|
|
120
|
+
/// </summary>
|
|
121
|
+
public static void ConfigureAtlas_Old()
|
|
122
|
+
{
|
|
123
|
+
// ❌ OLD (deprecated):
|
|
124
|
+
// var importer = (SpriteAtlasImporter)AssetImporter.GetAtPath(path);
|
|
125
|
+
// importer.SetBuildSettings(settings);
|
|
126
|
+
|
|
127
|
+
// ✅ NEW (V2):
|
|
128
|
+
SpriteAtlasImporter importer = null; // Get from AssetImporter
|
|
129
|
+
// importer.packingSettings = settings;
|
|
130
|
+
// importer.SaveAndReimport();
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
/// <summary>
|
|
134
|
+
/// Pattern 3: Loading an atlas at runtime
|
|
135
|
+
/// </summary>
|
|
136
|
+
public static void LoadAtlas_Runtime()
|
|
137
|
+
{
|
|
138
|
+
// ✅ CORRECT (runtime only):
|
|
139
|
+
// SpriteAtlasManager.atlasLoaded += OnAtlasLoaded;
|
|
140
|
+
// Or use Addressables/AssetBundles for dynamic loading
|
|
141
|
+
}
|
|
142
|
+
}
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
// [UNITY-SKILL:SPRITEATLAS]
|
|
2
|
+
using UnityEditor;
|
|
3
|
+
using UnityEditor.U2D;
|
|
4
|
+
|
|
5
|
+
/// <summary>
|
|
6
|
+
/// Demonstrates why you must call SaveAndReimport() after modifying SpriteAtlasImporter.
|
|
7
|
+
/// Changes to importer settings are not persisted without explicitly saving.
|
|
8
|
+
/// </summary>
|
|
9
|
+
public static class DontModifyWithoutSavingDocumentation
|
|
10
|
+
{
|
|
11
|
+
/// <summary>
|
|
12
|
+
/// ❌ WRONG: Modifying importer settings and expecting them to persist.
|
|
13
|
+
/// Unity's asset database requires explicit SaveAndReimport() calls.
|
|
14
|
+
/// </summary>
|
|
15
|
+
public static void Wrong_ModifyAndForget()
|
|
16
|
+
{
|
|
17
|
+
string path = "Assets/MyAtlas.spriteatlasv2";
|
|
18
|
+
|
|
19
|
+
SpriteAtlasImporter importer = AssetImporter.GetAtPath(path) as SpriteAtlasImporter;
|
|
20
|
+
if (importer != null)
|
|
21
|
+
{
|
|
22
|
+
// Make changes
|
|
23
|
+
importer.includeInBuild = true;
|
|
24
|
+
var packingSettings = importer.packingSettings;
|
|
25
|
+
packingSettings.enableTightPacking = true;
|
|
26
|
+
importer.packingSettings = packingSettings;
|
|
27
|
+
|
|
28
|
+
// ❌ NOT CALLING SaveAndReimport()!
|
|
29
|
+
// Changes are lost when Unity reimports or restarts
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/// <summary>
|
|
34
|
+
/// ❌ WRONG: Modifying multiple settings without saving.
|
|
35
|
+
/// Each setting change needs to be followed by SaveAndReimport().
|
|
36
|
+
/// </summary>
|
|
37
|
+
public static void Wrong_MultipleChangesNoSave()
|
|
38
|
+
{
|
|
39
|
+
string path = "Assets/MyAtlas.spriteatlasv2";
|
|
40
|
+
|
|
41
|
+
SpriteAtlasImporter importer = AssetImporter.GetAtPath(path) as SpriteAtlasImporter;
|
|
42
|
+
if (importer != null)
|
|
43
|
+
{
|
|
44
|
+
var packingSettings = importer.packingSettings;
|
|
45
|
+
var textureSettings = importer.GetPlatformSettings("DefaultTexturePlatform");
|
|
46
|
+
|
|
47
|
+
// Change 1: Include in build
|
|
48
|
+
importer.includeInBuild = true;
|
|
49
|
+
|
|
50
|
+
// Change 2: Tight packing
|
|
51
|
+
packingSettings.enableTightPacking = true;
|
|
52
|
+
|
|
53
|
+
// Change 3: Max texture size
|
|
54
|
+
textureSettings.maxTextureSize = 2048;
|
|
55
|
+
|
|
56
|
+
// Change 4: Format
|
|
57
|
+
textureSettings.format = TextureImporterFormat.ASTC_6x6;
|
|
58
|
+
|
|
59
|
+
importer.SetPlatformSettings(textureSettings);
|
|
60
|
+
importer.packingSettings = packingSettings;
|
|
61
|
+
|
|
62
|
+
// ❌ NOT CALLING SaveAndReimport()!
|
|
63
|
+
// All changes are lost
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
/// <summary>
|
|
68
|
+
/// ✅ CORRECT: Always call SaveAndReimport() after modifications.
|
|
69
|
+
/// This ensures changes are saved and the asset is reimported.
|
|
70
|
+
/// </summary>
|
|
71
|
+
public static void Correct_SaveAfterModify()
|
|
72
|
+
{
|
|
73
|
+
string path = "Assets/MyAtlas.spriteatlasv2";
|
|
74
|
+
|
|
75
|
+
SpriteAtlasImporter importer = AssetImporter.GetAtPath(path) as SpriteAtlasImporter;
|
|
76
|
+
if (importer != null)
|
|
77
|
+
{
|
|
78
|
+
var packingSettings = importer.packingSettings;
|
|
79
|
+
var textureSettings = importer.GetPlatformSettings("DefaultTexturePlatform");
|
|
80
|
+
|
|
81
|
+
// Change 1: Include in build
|
|
82
|
+
importer.includeInBuild = true;
|
|
83
|
+
|
|
84
|
+
// Change 2: Tight packing
|
|
85
|
+
packingSettings.enableTightPacking = true;
|
|
86
|
+
|
|
87
|
+
// Change 3: Max texture size
|
|
88
|
+
textureSettings.maxTextureSize = 2048;
|
|
89
|
+
|
|
90
|
+
// Change 4: Format
|
|
91
|
+
textureSettings.format = TextureImporterFormat.ASTC_6x6;
|
|
92
|
+
|
|
93
|
+
importer.SetPlatformSettings(textureSettings);
|
|
94
|
+
importer.packingSettings = packingSettings;
|
|
95
|
+
|
|
96
|
+
// ✅ CALL SaveAndReimport()!
|
|
97
|
+
importer.SaveAndReimport();
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
/// <summary>
|
|
103
|
+
/// Editor window that demonstrates the difference between saving and not saving.
|
|
104
|
+
/// </summary>
|
|
105
|
+
public class ModifyWithoutSavingDemo : EditorWindow
|
|
106
|
+
{
|
|
107
|
+
private static void CreateDemoAtlas(string path)
|
|
108
|
+
{
|
|
109
|
+
// Clean up if exists
|
|
110
|
+
if (System.IO.File.Exists(path))
|
|
111
|
+
{
|
|
112
|
+
AssetDatabase.DeleteAsset(path);
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
// Create new atlas
|
|
116
|
+
SpriteAtlasAsset asset = new SpriteAtlasAsset();
|
|
117
|
+
SpriteAtlasAsset.Save(asset, path);
|
|
118
|
+
AssetDatabase.ImportAsset(path);
|
|
119
|
+
}
|
|
120
|
+
}
|