@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,382 @@
|
|
|
1
|
+
# SpriteAtlas V2 API Reference
|
|
2
|
+
|
|
3
|
+
Complete API documentation for Unity's SpriteAtlas V2 system.
|
|
4
|
+
|
|
5
|
+
## Table of Contents
|
|
6
|
+
|
|
7
|
+
- [SpriteAtlasAsset (Editor Authoring)](#spriteatlasasset-editor-authoring)
|
|
8
|
+
- [SpriteAtlasImporter (Editor Settings)](#spriteatlasimporter-editor-settings)
|
|
9
|
+
- [SpriteAtlasUtility (Editor Packing)](#spriteatlasutility-editor-packing)
|
|
10
|
+
- [SpriteAtlas (Runtime)](#spriteatlas-runtime)
|
|
11
|
+
- [SpriteAtlasManager (Runtime Loading)](#spriteatlasmanager-runtime-loading)
|
|
12
|
+
- [Settings Structures](#settings-structures)
|
|
13
|
+
|
|
14
|
+
## SpriteAtlasAsset (Editor Authoring)
|
|
15
|
+
|
|
16
|
+
**Namespace:** `UnityEditor.U2D`
|
|
17
|
+
**Location:** `SpriteAtlasAsset.bindings.cs`
|
|
18
|
+
|
|
19
|
+
Primary API for adding/removing content from sprite atlases.
|
|
20
|
+
|
|
21
|
+
### Constructor
|
|
22
|
+
|
|
23
|
+
```csharp
|
|
24
|
+
SpriteAtlasAsset atlasAsset = new SpriteAtlasAsset();
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
### Content Management
|
|
28
|
+
|
|
29
|
+
```csharp
|
|
30
|
+
// Add sprites or folders
|
|
31
|
+
void Add(Object[] objects)
|
|
32
|
+
|
|
33
|
+
// Remove packables
|
|
34
|
+
void Remove(Object[] objects)
|
|
35
|
+
|
|
36
|
+
// Remove by index
|
|
37
|
+
void RemoveAt(int index)
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
### Persistence
|
|
41
|
+
|
|
42
|
+
```csharp
|
|
43
|
+
// Save to disk
|
|
44
|
+
static void Save(SpriteAtlasAsset asset, string path)
|
|
45
|
+
|
|
46
|
+
// Load from disk
|
|
47
|
+
static SpriteAtlasAsset Load(string path)
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
### Variant Configuration
|
|
51
|
+
|
|
52
|
+
```csharp
|
|
53
|
+
// Mark as variant atlas
|
|
54
|
+
void SetIsVariant(bool value)
|
|
55
|
+
|
|
56
|
+
// Check if variant
|
|
57
|
+
bool isVariant { get; }
|
|
58
|
+
|
|
59
|
+
// Set master atlas (requires SpriteAtlas reference)
|
|
60
|
+
void SetMasterAtlas(SpriteAtlas master)
|
|
61
|
+
|
|
62
|
+
// Get master atlas
|
|
63
|
+
SpriteAtlas GetMasterAtlas()
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
### Custom Packer
|
|
67
|
+
|
|
68
|
+
```csharp
|
|
69
|
+
// Set custom packing algorithm
|
|
70
|
+
void SetScriptablePacker(Object packer)
|
|
71
|
+
|
|
72
|
+
// Get current packer
|
|
73
|
+
Object GetPacker()
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
### Deprecated Methods
|
|
77
|
+
|
|
78
|
+
These methods are deprecated in V2. Use `SpriteAtlasImporter` instead:
|
|
79
|
+
|
|
80
|
+
- `SetVariantScale()` → Use `SpriteAtlasImporter.variantScale`
|
|
81
|
+
- `SetIncludeInBuild()` → Use `SpriteAtlasImporter.includeInBuild`
|
|
82
|
+
- `IsIncludeInBuild()` → Use `SpriteAtlasImporter.includeInBuild`
|
|
83
|
+
- `SetPlatformSettings()` → Use `SpriteAtlasImporter.SetPlatformSettings()`
|
|
84
|
+
- `SetTextureSettings()` → Use `SpriteAtlasImporter.textureSettings`
|
|
85
|
+
- `SetPackingSettings()` → Use `SpriteAtlasImporter.packingSettings`
|
|
86
|
+
|
|
87
|
+
## SpriteAtlasImporter (Editor Settings)
|
|
88
|
+
|
|
89
|
+
**Namespace:** `UnityEditor.U2D`
|
|
90
|
+
**Location:** `SpriteAtlasImporter.bindings.cs`
|
|
91
|
+
|
|
92
|
+
Primary API for configuring all sprite atlas settings.
|
|
93
|
+
|
|
94
|
+
### Getting the Importer
|
|
95
|
+
|
|
96
|
+
```csharp
|
|
97
|
+
string path = "Assets/MyAtlas.spriteatlas";
|
|
98
|
+
SpriteAtlasImporter importer = AssetImporter.GetAtPath(path) as SpriteAtlasImporter;
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
### Basic Properties
|
|
102
|
+
|
|
103
|
+
```csharp
|
|
104
|
+
// Variant scale multiplier
|
|
105
|
+
float variantScale { get; set; }
|
|
106
|
+
|
|
107
|
+
// Include atlas in player build
|
|
108
|
+
bool includeInBuild { get; set; }
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
### Texture Settings
|
|
112
|
+
|
|
113
|
+
```csharp
|
|
114
|
+
// Get/set texture settings (struct)
|
|
115
|
+
SpriteAtlasTextureSettings textureSettings { get; set; }
|
|
116
|
+
|
|
117
|
+
// Example:
|
|
118
|
+
SpriteAtlasTextureSettings settings = importer.textureSettings;
|
|
119
|
+
settings.filterMode = FilterMode.Bilinear;
|
|
120
|
+
settings.generateMipMaps = false;
|
|
121
|
+
settings.readable = false;
|
|
122
|
+
settings.sRGB = true;
|
|
123
|
+
importer.textureSettings = settings;
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
### Packing Settings
|
|
127
|
+
|
|
128
|
+
```csharp
|
|
129
|
+
// Get/set packing settings (struct)
|
|
130
|
+
SpriteAtlasPackingSettings packingSettings { get; set; }
|
|
131
|
+
|
|
132
|
+
// Example:
|
|
133
|
+
SpriteAtlasPackingSettings settings = importer.packingSettings;
|
|
134
|
+
settings.padding = 4;
|
|
135
|
+
settings.enableRotation = false;
|
|
136
|
+
settings.enableTightPacking = false;
|
|
137
|
+
settings.enableAlphaDilation = true;
|
|
138
|
+
importer.packingSettings = settings;
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
### Platform Settings
|
|
142
|
+
|
|
143
|
+
```csharp
|
|
144
|
+
// Get platform-specific settings
|
|
145
|
+
TextureImporterPlatformSettings GetPlatformSettings(string platform)
|
|
146
|
+
|
|
147
|
+
// Set platform-specific settings
|
|
148
|
+
void SetPlatformSettings(TextureImporterPlatformSettings settings)
|
|
149
|
+
|
|
150
|
+
// Example:
|
|
151
|
+
TextureImporterPlatformSettings platformSettings = importer.GetPlatformSettings("Android");
|
|
152
|
+
platformSettings.overridden = true;
|
|
153
|
+
platformSettings.maxTextureSize = 2048;
|
|
154
|
+
platformSettings.format = TextureImporterFormat.ASTC_6x6;
|
|
155
|
+
platformSettings.compressionQuality = 50;
|
|
156
|
+
importer.SetPlatformSettings(platformSettings);
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
Platform names: "Standalone", "Android", "iOS", "WebGL", etc.
|
|
160
|
+
|
|
161
|
+
### Applying Changes
|
|
162
|
+
|
|
163
|
+
```csharp
|
|
164
|
+
// REQUIRED: Save and reimport after any changes
|
|
165
|
+
void SaveAndReimport()
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
**Critical:** Always call `SaveAndReimport()` after modifying importer properties.
|
|
169
|
+
|
|
170
|
+
## SpriteAtlasUtility (Editor Packing)
|
|
171
|
+
|
|
172
|
+
**Namespace:** `UnityEditor.U2D`
|
|
173
|
+
**Location:** `EditorSpritePacking.bindings.cs`
|
|
174
|
+
|
|
175
|
+
Utilities for packing sprite atlases.
|
|
176
|
+
|
|
177
|
+
### Packing Operations
|
|
178
|
+
|
|
179
|
+
```csharp
|
|
180
|
+
// Pack all atlases in project for target platform
|
|
181
|
+
static void PackAllAtlases(BuildTarget target, bool canCancel)
|
|
182
|
+
|
|
183
|
+
// Pack specific atlases
|
|
184
|
+
static void PackAtlases(SpriteAtlas[] atlases, BuildTarget target, bool canCancel)
|
|
185
|
+
|
|
186
|
+
// Clean up packing temporary data
|
|
187
|
+
static void CleanupAtlasPacking()
|
|
188
|
+
```
|
|
189
|
+
|
|
190
|
+
### Usage
|
|
191
|
+
|
|
192
|
+
```csharp
|
|
193
|
+
using UnityEditor;
|
|
194
|
+
using UnityEditor.U2D;
|
|
195
|
+
|
|
196
|
+
BuildTarget target = EditorUserBuildSettings.activeBuildTarget;
|
|
197
|
+
|
|
198
|
+
// Pack all
|
|
199
|
+
SpriteAtlasUtility.PackAllAtlases(target, canCancel: true);
|
|
200
|
+
SpriteAtlasUtility.CleanupAtlasPacking();
|
|
201
|
+
|
|
202
|
+
// Pack specific
|
|
203
|
+
SpriteAtlas[] atlases = new[] { atlas1, atlas2 };
|
|
204
|
+
SpriteAtlasUtility.PackAtlases(atlases, target, canCancel: false);
|
|
205
|
+
SpriteAtlasUtility.CleanupAtlasPacking();
|
|
206
|
+
```
|
|
207
|
+
|
|
208
|
+
**Important:** Always call `CleanupAtlasPacking()` after batch packing operations.
|
|
209
|
+
|
|
210
|
+
## SpriteAtlas (Runtime)
|
|
211
|
+
|
|
212
|
+
**Namespace:** `UnityEngine.U2D`
|
|
213
|
+
**Location:** `Runtime/2D/SpriteAtlas/ScriptBindings/SpriteAtlas.bindings.cs`
|
|
214
|
+
|
|
215
|
+
**RUNTIME ONLY** - Do not script against SpriteAtlas in editor code. Provides read-only access to packed sprites.
|
|
216
|
+
|
|
217
|
+
### Properties
|
|
218
|
+
|
|
219
|
+
```csharp
|
|
220
|
+
// Total sprite count in atlas
|
|
221
|
+
int spriteCount { get; }
|
|
222
|
+
|
|
223
|
+
// Atlas tag identifier
|
|
224
|
+
string tag { get; }
|
|
225
|
+
|
|
226
|
+
// Check if atlas is variant
|
|
227
|
+
bool isVariant { get; }
|
|
228
|
+
```
|
|
229
|
+
|
|
230
|
+
### Sprite Queries
|
|
231
|
+
|
|
232
|
+
```csharp
|
|
233
|
+
// Get sprite by name
|
|
234
|
+
Sprite GetSprite(string name)
|
|
235
|
+
|
|
236
|
+
// Get all sprites
|
|
237
|
+
int GetSprites(Sprite[] sprites)
|
|
238
|
+
|
|
239
|
+
// Get sprites matching name prefix
|
|
240
|
+
int GetSprites(Sprite[] sprites, string namePrefix)
|
|
241
|
+
|
|
242
|
+
// Check if sprite belongs to atlas
|
|
243
|
+
bool CanBindTo(Sprite sprite)
|
|
244
|
+
```
|
|
245
|
+
|
|
246
|
+
### Usage
|
|
247
|
+
|
|
248
|
+
```csharp
|
|
249
|
+
using UnityEngine;
|
|
250
|
+
using UnityEngine.U2D;
|
|
251
|
+
|
|
252
|
+
SpriteAtlas atlas = Resources.Load<SpriteAtlas>("MyAtlas");
|
|
253
|
+
|
|
254
|
+
// Get specific sprite
|
|
255
|
+
Sprite sprite = atlas.GetSprite("SpriteName");
|
|
256
|
+
|
|
257
|
+
// Get all sprites
|
|
258
|
+
Sprite[] allSprites = new Sprite[atlas.spriteCount];
|
|
259
|
+
int count = atlas.GetSprites(allSprites);
|
|
260
|
+
|
|
261
|
+
// Get sprites with prefix
|
|
262
|
+
Sprite[] enemySprites = new Sprite[atlas.spriteCount];
|
|
263
|
+
int enemyCount = atlas.GetSprites(enemySprites, "Enemy_");
|
|
264
|
+
|
|
265
|
+
// Validate sprite binding
|
|
266
|
+
bool canBind = atlas.CanBindTo(sprite);
|
|
267
|
+
```
|
|
268
|
+
|
|
269
|
+
## SpriteAtlasManager (Runtime Loading)
|
|
270
|
+
|
|
271
|
+
**Namespace:** `UnityEngine.U2D`
|
|
272
|
+
**Location:** `Runtime/2D/SpriteAtlas/ScriptBindings/SpriteAtlas.bindings.cs`
|
|
273
|
+
|
|
274
|
+
Manages atlas loading callbacks and runtime creation.
|
|
275
|
+
|
|
276
|
+
### Events
|
|
277
|
+
|
|
278
|
+
```csharp
|
|
279
|
+
// Called when an atlas is requested (late binding)
|
|
280
|
+
static event Action<string, Action<SpriteAtlas>> atlasRequested
|
|
281
|
+
|
|
282
|
+
// Called when an atlas is registered
|
|
283
|
+
static event Action<SpriteAtlas> atlasRegistered
|
|
284
|
+
```
|
|
285
|
+
|
|
286
|
+
### Late Binding Pattern
|
|
287
|
+
|
|
288
|
+
```csharp
|
|
289
|
+
using UnityEngine;
|
|
290
|
+
using UnityEngine.U2D;
|
|
291
|
+
|
|
292
|
+
public class AtlasLoader : MonoBehaviour
|
|
293
|
+
{
|
|
294
|
+
void OnEnable()
|
|
295
|
+
{
|
|
296
|
+
SpriteAtlasManager.atlasRequested += OnAtlasRequested;
|
|
297
|
+
SpriteAtlasManager.atlasRegistered += OnAtlasRegistered;
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
void OnDisable()
|
|
301
|
+
{
|
|
302
|
+
SpriteAtlasManager.atlasRequested -= OnAtlasRequested;
|
|
303
|
+
SpriteAtlasManager.atlasRegistered -= OnAtlasRegistered;
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
void OnAtlasRequested(string tag, System.Action<SpriteAtlas> callback)
|
|
307
|
+
{
|
|
308
|
+
// Load atlas from Resources or AssetBundle
|
|
309
|
+
SpriteAtlas atlas = Resources.Load<SpriteAtlas>($"Atlases/{tag}");
|
|
310
|
+
callback(atlas);
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
void OnAtlasRegistered(SpriteAtlas atlas)
|
|
314
|
+
{
|
|
315
|
+
Debug.Log($"Atlas registered: {atlas.tag}");
|
|
316
|
+
}
|
|
317
|
+
}
|
|
318
|
+
```
|
|
319
|
+
|
|
320
|
+
### Runtime Atlas Creation
|
|
321
|
+
|
|
322
|
+
```csharp
|
|
323
|
+
// Create atlas at runtime
|
|
324
|
+
static SpriteAtlas CreateSpriteAtlas(string name,
|
|
325
|
+
SpriteAtlasRuntimeConfig config,
|
|
326
|
+
AtlasPage[] pages)
|
|
327
|
+
```
|
|
328
|
+
|
|
329
|
+
Advanced usage for dynamic atlas generation. See custom-packing.md for details.
|
|
330
|
+
|
|
331
|
+
## Settings Structures
|
|
332
|
+
|
|
333
|
+
### SpriteAtlasTextureSettings
|
|
334
|
+
|
|
335
|
+
```csharp
|
|
336
|
+
struct SpriteAtlasTextureSettings
|
|
337
|
+
{
|
|
338
|
+
int maxTextureSize { get; } // Read-only
|
|
339
|
+
int anisoLevel { get; set; } // Anisotropic filtering level
|
|
340
|
+
FilterMode filterMode { get; set; } // Point, Bilinear, Trilinear
|
|
341
|
+
bool generateMipMaps { get; set; } // Enable mipmap generation
|
|
342
|
+
bool readable { get; set; } // CPU-readable texture
|
|
343
|
+
bool sRGB { get; set; } // Use sRGB color space
|
|
344
|
+
}
|
|
345
|
+
```
|
|
346
|
+
|
|
347
|
+
### SpriteAtlasPackingSettings
|
|
348
|
+
|
|
349
|
+
```csharp
|
|
350
|
+
struct SpriteAtlasPackingSettings
|
|
351
|
+
{
|
|
352
|
+
int blockOffset { get; set; } // Block offset for algorithm
|
|
353
|
+
int padding { get; set; } // Padding between sprites (pixels)
|
|
354
|
+
bool enableRotation { get; set; } // Allow sprite rotation
|
|
355
|
+
bool enableTightPacking { get; set; } // Pack around sprite meshes
|
|
356
|
+
bool enableAlphaDilation { get; set; } // Prevent bleeding artifacts
|
|
357
|
+
}
|
|
358
|
+
```
|
|
359
|
+
|
|
360
|
+
### TextureImporterPlatformSettings
|
|
361
|
+
|
|
362
|
+
Used for platform-specific configuration. See Unity's `TextureImporter` documentation for complete reference.
|
|
363
|
+
|
|
364
|
+
Common fields:
|
|
365
|
+
```csharp
|
|
366
|
+
class TextureImporterPlatformSettings
|
|
367
|
+
{
|
|
368
|
+
string name { get; set; } // Platform name
|
|
369
|
+
bool overridden { get; set; } // Override default settings
|
|
370
|
+
int maxTextureSize { get; set; } // Max size (32-8192)
|
|
371
|
+
TextureImporterFormat format { get; set; } // Compression format
|
|
372
|
+
int compressionQuality { get; set; } // Quality (0-100)
|
|
373
|
+
}
|
|
374
|
+
```
|
|
375
|
+
|
|
376
|
+
Common platform names: "Standalone", "Android", "iOS", "WebGL"
|
|
377
|
+
|
|
378
|
+
Common formats:
|
|
379
|
+
- Android: `TextureImporterFormat.ASTC_6x6`, `TextureImporterFormat.ETC2_RGBA8`
|
|
380
|
+
- iOS: `TextureImporterFormat.ASTC_6x6`, `TextureImporterFormat.PVRTC_RGBA4`
|
|
381
|
+
- Desktop: `TextureImporterFormat.DXT5`, `TextureImporterFormat.BC7`
|
|
382
|
+
- WebGL: `TextureImporterFormat.DXT5`
|
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
# SpriteAtlas V2 Best Practices
|
|
2
|
+
|
|
3
|
+
Optimization tips, common pitfalls, and recommended patterns for SpriteAtlas V2.
|
|
4
|
+
|
|
5
|
+
## Table of Contents
|
|
6
|
+
|
|
7
|
+
- [V2 Architecture Rules (Critical)](#v2-architecture-rules-critical)
|
|
8
|
+
- [Editor Code Best Practices](#editor-code-best-practices)
|
|
9
|
+
- [Always Use SpriteAtlasImporter for Configuration](#always-use-spriteatlasimporter-for-configuration)
|
|
10
|
+
- [Save SpriteAtlasAsset Properly](#save-spriteatlasasset-properly)
|
|
11
|
+
- [Clean Up After Batch Operations](#clean-up-after-batch-operations)
|
|
12
|
+
- [Handle Null Cases](#handle-null-cases)
|
|
13
|
+
- [Use Correct Platform Names](#use-correct-platform-names)
|
|
14
|
+
- [Runtime Code Best Practices](#runtime-code-best-practices)
|
|
15
|
+
- [Register Callbacks Early](#register-callbacks-early)
|
|
16
|
+
- [Cache Loaded Atlases](#cache-loaded-atlases)
|
|
17
|
+
- [Handle Late Binding Properly](#handle-late-binding-properly)
|
|
18
|
+
- [Validate Sprite Binding](#validate-sprite-binding)
|
|
19
|
+
- [Query Sprites Efficiently](#query-sprites-efficiently)
|
|
20
|
+
- [Performance Best Practices](#performance-best-practices)
|
|
21
|
+
- [Optimize Texture Settings](#optimize-texture-settings)
|
|
22
|
+
- [Enable Tight Packing](#enable-tight-packing)
|
|
23
|
+
- [Use Variants Wisely](#use-variants-wisely)
|
|
24
|
+
- [Batch Pack Operations](#batch-pack-operations)
|
|
25
|
+
- [Enable Alpha Dilation](#enable-alpha-dilation)
|
|
26
|
+
- [Set includeInBuild Appropriately](#set-includeinbuild-appropriately)
|
|
27
|
+
- [Common Pitfalls](#common-pitfalls)
|
|
28
|
+
- [Don't Script SpriteAtlas in Editor](#dont-script-spriteatlas-in-editor)
|
|
29
|
+
- [Don't Use Deprecated SpriteAtlasAsset Methods](#dont-use-deprecated-spriteatlasasset-methods)
|
|
30
|
+
- [Don't Forget to Reimport](#dont-forget-to-reimport)
|
|
31
|
+
- [Don't Pack in Runtime Builds](#dont-pack-in-runtime-builds)
|
|
32
|
+
- [Don't Modify Importer Without Saving](#dont-modify-importer-without-saving)
|
|
33
|
+
- [Don't Confuse Authoring vs Runtime](#dont-confuse-authoring-vs-runtime)
|
|
34
|
+
- [Migration from V1 to V2](#migration-from-v1-to-v2)
|
|
35
|
+
- [Replace Direct SpriteAtlas Scripting](#replace-direct-spriteatlas-scripting)
|
|
36
|
+
- [Update Settings Configuration](#update-settings-configuration)
|
|
37
|
+
- [Update Build Scripts](#update-build-scripts)
|
|
38
|
+
- [Checklist](#checklist)
|
|
39
|
+
- [Before Creating an Atlas](#before-creating-an-atlas)
|
|
40
|
+
- [When Creating an Atlas](#when-creating-an-atlas)
|
|
41
|
+
- [When Packing Atlases](#when-packing-atlases)
|
|
42
|
+
- [Runtime Loading](#runtime-loading)
|
|
43
|
+
|
|
44
|
+
## V2 Architecture Rules (Critical)
|
|
45
|
+
|
|
46
|
+
1. **NEVER script against SpriteAtlas in editor code** - SpriteAtlas is runtime-only in V2
|
|
47
|
+
2. **Use SpriteAtlasAsset for content authoring** - Add/remove sprites and folders
|
|
48
|
+
3. **Use SpriteAtlasImporter for all settings** - Texture, packing, platform, and variant configuration
|
|
49
|
+
4. **Follow the two-step pattern** - Create asset with SpriteAtlasAsset, configure with SpriteAtlasImporter
|
|
50
|
+
5. **Always call SaveAndReimport()** - Required after modifying importer settings
|
|
51
|
+
|
|
52
|
+
## Editor Code Best Practices
|
|
53
|
+
|
|
54
|
+
### Always Use SpriteAtlasImporter for Configuration
|
|
55
|
+
|
|
56
|
+
See [resources/editorconfiguration.cs](../resources/editorconfiguration.cs).
|
|
57
|
+
|
|
58
|
+
### Save SpriteAtlasAsset Properly
|
|
59
|
+
|
|
60
|
+
See [resources/savespriteatlasasset.cs](../resources/savespriteatlasasset.cs).
|
|
61
|
+
|
|
62
|
+
### Clean Up After Batch Operations
|
|
63
|
+
|
|
64
|
+
See [resources/cleanupbatchoperations.cs](../resources/cleanupbatchoperations.cs).
|
|
65
|
+
|
|
66
|
+
### Handle Null Cases
|
|
67
|
+
|
|
68
|
+
See [resources/handlenullcases.cs](../resources/handlenullcases.cs).
|
|
69
|
+
|
|
70
|
+
### Use Correct Platform Names
|
|
71
|
+
|
|
72
|
+
See [resources/platformnames.cs](../resources/platformnames.cs).
|
|
73
|
+
|
|
74
|
+
## Runtime Code Best Practices
|
|
75
|
+
|
|
76
|
+
### Register Callbacks Early
|
|
77
|
+
|
|
78
|
+
See [resources/registercallbacks.cs](../resources/registercallbacks.cs).
|
|
79
|
+
|
|
80
|
+
### Cache Loaded Atlases
|
|
81
|
+
|
|
82
|
+
See [resources/cacheloadedatlases.cs](../resources/cacheloadedatlases.cs).
|
|
83
|
+
|
|
84
|
+
### Handle Late Binding Properly
|
|
85
|
+
|
|
86
|
+
See [resources/handlelatebinding.cs](../resources/handlelatebinding.cs).
|
|
87
|
+
|
|
88
|
+
### Query Sprites Efficiently
|
|
89
|
+
|
|
90
|
+
See [resources/queryspritesefficiently.cs](../resources/queryspritesefficiently.cs).
|
|
91
|
+
|
|
92
|
+
## Performance Best Practices
|
|
93
|
+
|
|
94
|
+
### Optimize Texture Settings
|
|
95
|
+
|
|
96
|
+
See [resources/optimizetexturesettings.cs](../resources/optimizetexturesettings.cs).
|
|
97
|
+
|
|
98
|
+
### Enable Tight Packing
|
|
99
|
+
|
|
100
|
+
See [resources/enablespritepacking.cs](../resources/enablespritepacking.cs).
|
|
101
|
+
|
|
102
|
+
### Use Variants Wisely
|
|
103
|
+
|
|
104
|
+
See [resources/usevariantswisely.cs](../resources/usevariantswisely.cs).
|
|
105
|
+
|
|
106
|
+
### Set includeInBuild Appropriately
|
|
107
|
+
|
|
108
|
+
See [resources/setincludeinbuild.cs](../resources/setincludeinbuild.cs).
|
|
109
|
+
|
|
110
|
+
## Common Pitfalls
|
|
111
|
+
|
|
112
|
+
### Don't Script SpriteAtlas in Editor
|
|
113
|
+
|
|
114
|
+
See [resources/dontscriptspriteatlasineditor.cs](../resources/dontscriptspriteatlasineditor.cs).
|
|
115
|
+
|
|
116
|
+
### Don't Use Deprecated SpriteAtlasAsset Methods
|
|
117
|
+
|
|
118
|
+
See [resources/deprecatedmethods.cs](../resources/deprecatedmethods.cs).
|
|
119
|
+
|
|
120
|
+
### Don't Pack in Runtime Builds
|
|
121
|
+
|
|
122
|
+
See [resources/dontpackinruntimebuilds.cs](../resources/dontpackinruntimebuilds.cs).
|
|
123
|
+
|
|
124
|
+
### Don't Modify Importer Without Saving
|
|
125
|
+
|
|
126
|
+
See [resources/dontmodifywithoutsaving.cs](../resources/dontmodifywithoutsaving.cs).
|
|
127
|
+
|
|
128
|
+
### Don't Confuse Authoring vs Runtime
|
|
129
|
+
|
|
130
|
+
See [resources/authoringvsruntime.cs](../resources/authoringvsruntime.cs).
|
|
131
|
+
|
|
132
|
+
## Migration from V1 to V2
|
|
133
|
+
|
|
134
|
+
If migrating from V1 code:
|
|
135
|
+
|
|
136
|
+
### Replace Direct SpriteAtlas Scripting
|
|
137
|
+
|
|
138
|
+
See [resources/migratev1tov2.cs](../resources/migratev1tov2.cs).
|
|
139
|
+
|
|
140
|
+
### Update Settings Configuration
|
|
141
|
+
|
|
142
|
+
See [resources/updatesettingsconfiguration.cs](../resources/updatesettingsconfiguration.cs).
|
|
143
|
+
|
|
144
|
+
### Update Build Scripts
|
|
145
|
+
|
|
146
|
+
See [resources/updatebuildscripts.cs](../resources/updatebuildscripts.cs).
|
|
147
|
+
|
|
148
|
+
## Checklist
|
|
149
|
+
|
|
150
|
+
### Before Creating an Atlas
|
|
151
|
+
|
|
152
|
+
- [ ] Know what sprites to include
|
|
153
|
+
- [ ] Determine target platforms and formats
|
|
154
|
+
- [ ] Decide on texture quality settings
|
|
155
|
+
- [ ] Plan for variants if needed
|
|
156
|
+
|
|
157
|
+
### When Creating an Atlas
|
|
158
|
+
|
|
159
|
+
- [ ] Create SpriteAtlasAsset
|
|
160
|
+
- [ ] Add sprites or folders
|
|
161
|
+
- [ ] Save to disk with SpriteAtlasAsset.Save()
|
|
162
|
+
- [ ] Import with AssetDatabase.ImportAsset()
|
|
163
|
+
- [ ] Get SpriteAtlasImporter
|
|
164
|
+
- [ ] Configure texture settings
|
|
165
|
+
- [ ] Configure packing settings
|
|
166
|
+
- [ ] Configure platform settings
|
|
167
|
+
- [ ] Set includeInBuild
|
|
168
|
+
- [ ] Call SaveAndReimport()
|
|
169
|
+
|
|
170
|
+
### When Packing Atlases
|
|
171
|
+
|
|
172
|
+
- [ ] Use appropriate BuildTarget
|
|
173
|
+
- [ ] Wrap in try/finally block
|
|
174
|
+
- [ ] Call CleanupAtlasPacking() in finally
|
|
175
|
+
- [ ] Validate packing results
|
|
176
|
+
|
|
177
|
+
### Runtime Loading
|
|
178
|
+
|
|
179
|
+
- [ ] Register callbacks early (Awake/OnEnable)
|
|
180
|
+
- [ ] Unregister callbacks (OnDestroy/OnDisable)
|
|
181
|
+
- [ ] Cache loaded atlases
|
|
182
|
+
- [ ] Handle load failures gracefully
|
|
183
|
+
- [ ] Use async loading when possible
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
# Common Errors and Invalid Patterns
|
|
2
|
+
|
|
3
|
+
This document covers invalid V2 patterns, API corrections, and common mistakes to avoid.
|
|
4
|
+
|
|
5
|
+
## Table of Contents
|
|
6
|
+
|
|
7
|
+
- [Invalid V2 Patterns (Do Not Use)](#invalid-v2-patterns-do-not-use)
|
|
8
|
+
- [Critical API Corrections](#critical-api-corrections)
|
|
9
|
+
- [❌ Format Casting in TextureImporterPlatformSettings](#-format-casting-in-textureimporterplatformsettings)
|
|
10
|
+
- [❌ SetMasterAtlasPath() - Method Does Not Exist](#-setmasteratlaspath---method-does-not-exist)
|
|
11
|
+
- [⚠ Platform-Specific Format Limitations](#-platform-specific-format-limitations)
|
|
12
|
+
- [⚠ PackAtlases() Requires Runtime SpriteAtlas[]](#-packatlases-requires-runtime-spriteatlas)
|
|
13
|
+
- [⚠ Always scope AssetDatabase.FindAssets to the folders you mean](#-always-scope-assetdatabasefindassets-to-the-folders-you-mean)
|
|
14
|
+
- [⚠ AssetImporter.GetAtPath() Takes Single Argument](#-assetimportergetatpath-takes-single-argument)
|
|
15
|
+
|
|
16
|
+
## Invalid V2 Patterns (Do Not Use)
|
|
17
|
+
|
|
18
|
+
```csharp
|
|
19
|
+
// ❌ WRONG - V1 pattern (scripting SpriteAtlas in editor)
|
|
20
|
+
SpriteAtlas atlas = new SpriteAtlas();
|
|
21
|
+
atlas.Add(sprites); // Invalid in V2
|
|
22
|
+
atlas.SetTextureSettings(settings); // Invalid in V2
|
|
23
|
+
|
|
24
|
+
// ❌ WRONG - Deprecated/invalid SpriteAtlasAsset methods
|
|
25
|
+
atlasAsset.SetTextureSettings(settings); // Use importer instead
|
|
26
|
+
atlasAsset.SetPackingSettings(settings); // Use importer instead
|
|
27
|
+
atlasAsset.SetIncludeInBuild(true); // Use importer instead
|
|
28
|
+
|
|
29
|
+
// ❌ WRONG - Creating variants from runtime SpriteAtlas
|
|
30
|
+
SpriteAtlasAsset masterAsset = ...;
|
|
31
|
+
atlasVariant.Add(masterAsset.GetPackables()); // GetPackables() doesn't exist on SpriteAtlasAsset!
|
|
32
|
+
|
|
33
|
+
// ❌ WRONG - Incorrect packable handling in variants
|
|
34
|
+
SpriteAtlasAsset variant = new SpriteAtlasAsset();
|
|
35
|
+
variant.SetMasterAtlas(atlasPath); // WRONG: SetMasterAtlas expects a Runtime SpriteAtlas, not path or SpriteAtlasAsset!
|
|
36
|
+
|
|
37
|
+
// ❌ WRONG - Format cast in TextureImporterPlatformSettings
|
|
38
|
+
var settings = new TextureImporterPlatformSettings {
|
|
39
|
+
format = (int)TextureImporterFormat.ASTC_6x6 // ❌ Explicit cast causes compile error
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
// ❌ WRONG - Using deprecated/invalid method
|
|
43
|
+
variant.SetMasterAtlasPath(path); // Method doesn't exist - use SetMasterAtlas() with runtime SpriteAtlas
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
## Critical API Corrections
|
|
47
|
+
|
|
48
|
+
### ❌ Format Casting in TextureImporterPlatformSettings
|
|
49
|
+
|
|
50
|
+
```csharp
|
|
51
|
+
// ❌ WRONG - Explicit cast causes compile error
|
|
52
|
+
var settings = new TextureImporterPlatformSettings {
|
|
53
|
+
format = (int)TextureImporterFormat.ASTC_6x6
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
// ✅ CORRECT - Direct enum assignment
|
|
57
|
+
var settings = new TextureImporterPlatformSettings {
|
|
58
|
+
format = TextureImporterFormat.ASTC_6x6
|
|
59
|
+
};
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
### ❌ SetMasterAtlasPath() - Method Does Not Exist
|
|
63
|
+
|
|
64
|
+
```csharp
|
|
65
|
+
// ❌ WRONG - Method doesn't exist
|
|
66
|
+
variant.SetMasterAtlasPath(path);
|
|
67
|
+
|
|
68
|
+
// ✅ CORRECT - Load runtime SpriteAtlas and pass to SetMasterAtlas()
|
|
69
|
+
SpriteAtlas masterRuntime = AssetDatabase.LoadAssetAtPath<SpriteAtlas>(masterPath);
|
|
70
|
+
variant.SetMasterAtlas(masterRuntime);
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
### ⚠ Platform-Specific Format Limitations
|
|
74
|
+
|
|
75
|
+
- **PVRTC is NOT supported** in SpriteAtlas V2
|
|
76
|
+
- Use **ASTC** for Android (`ASTC_6x6`, `ASTC_4x4`)
|
|
77
|
+
- Use **ASTC or ETC2** for iOS (`ASTC_4x4`, `ETC2_RGBA8`)
|
|
78
|
+
- Use **ETC2** for desktop (`ETC2_RGBA8`)
|
|
79
|
+
|
|
80
|
+
### ⚠ PackAtlases() Requires Runtime SpriteAtlas[]
|
|
81
|
+
|
|
82
|
+
```csharp
|
|
83
|
+
// ❌ WRONG - Passing SpriteAtlasAsset[] causes compilation error
|
|
84
|
+
SpriteAtlasUtility.PackAtlases(atlasAssets, ...);
|
|
85
|
+
|
|
86
|
+
// ✅ CORRECT - Load runtime SpriteAtlases first
|
|
87
|
+
SpriteAtlas[] atlases = AssetDatabase.FindAssets("t:SpriteAtlas", new[] { "Assets" })
|
|
88
|
+
.Select(g => AssetDatabase.LoadAssetAtPath<SpriteAtlas>(AssetDatabase.GUIDToAssetPath(g)))
|
|
89
|
+
.Where(a => a != null)
|
|
90
|
+
.ToArray();
|
|
91
|
+
SpriteAtlasUtility.PackAtlases(atlases, EditorUserBuildSettings.activeBuildTarget, false);
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
### ⚠ Always scope AssetDatabase.FindAssets to the folders you mean
|
|
95
|
+
|
|
96
|
+
```csharp
|
|
97
|
+
// ❌ WRONG - does not compile. There is no SearchMode overload.
|
|
98
|
+
string[] guids = AssetDatabase.FindAssets("t:SpriteAtlas", SearchMode.AllAssets);
|
|
99
|
+
|
|
100
|
+
// ❌ RISKY - compiles, but searches the WHOLE project including read-only packages
|
|
101
|
+
string[] guids = AssetDatabase.FindAssets("t:SpriteAtlas");
|
|
102
|
+
|
|
103
|
+
// ✅ CORRECT - the second parameter is string[] searchInFolders
|
|
104
|
+
string[] guids = AssetDatabase.FindAssets("t:SpriteAtlas", new[] { "Assets" });
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
`AssetDatabase.FindAssets` has exactly two overloads, `FindAssets(string filter)` and
|
|
108
|
+
`FindAssets(string filter, string[] searchInFolders)`. Verified on Unity 6000.5.8f1.
|
|
109
|
+
|
|
110
|
+
Scoping matters because an unscoped search reaches into `Packages/`, and those assets are usually
|
|
111
|
+
read-only. Measured on a real project: an unscoped `t:Scene` search returned 20 scenes where the
|
|
112
|
+
project itself has 1, and all 19 extras were package test fixtures. A batch operation that then
|
|
113
|
+
writes to what it found will fail, or worse, target assets it must not modify.
|
|
114
|
+
|
|
115
|
+
### ⚠ AssetImporter.GetAtPath() Takes Single Argument
|
|
116
|
+
|
|
117
|
+
```csharp
|
|
118
|
+
// ❌ WRONG - No such overload
|
|
119
|
+
SpriteAtlasImporter importer = AssetImporter.GetAtPath(path, typeof(SpriteAtlasImporter));
|
|
120
|
+
|
|
121
|
+
// ✅ CORRECT - Single argument, cast result
|
|
122
|
+
SpriteAtlasImporter importer = AssetImporter.GetAtPath(path) as SpriteAtlasImporter;
|
|
123
|
+
```
|