@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,357 @@
|
|
|
1
|
+
// [UNITY-SKILL:SPRITEATLAS]
|
|
2
|
+
using UnityEditor;
|
|
3
|
+
using UnityEditor.Build;
|
|
4
|
+
using UnityEditor.Build.Reporting;
|
|
5
|
+
using UnityEditor.U2D;
|
|
6
|
+
using UnityEngine;
|
|
7
|
+
|
|
8
|
+
/// <summary>
|
|
9
|
+
/// Demonstrates updating build scripts for SpriteAtlas V2.
|
|
10
|
+
/// Shows how to migrate from old build patterns to the prebuild pipeline.
|
|
11
|
+
/// </summary>
|
|
12
|
+
public static class UpdateBuildScriptsDocumentation
|
|
13
|
+
{
|
|
14
|
+
/// <summary>
|
|
15
|
+
/// OLD Pattern: Manual atlas packing in build script (NO LONGER RECOMMENDED)
|
|
16
|
+
///
|
|
17
|
+
/// ❌ OLD CODE:
|
|
18
|
+
/// public static void BuildGame()
|
|
19
|
+
/// {
|
|
20
|
+
/// // Manually pack atlases before build
|
|
21
|
+
/// SpriteAtlasUtility.PackAtlases(atlases, target);
|
|
22
|
+
/// BuildPipeline.BuildPlayer(...);
|
|
23
|
+
/// }
|
|
24
|
+
///
|
|
25
|
+
/// ✅ NEW V2 CODE:
|
|
26
|
+
/// Implement IPreprocessBuildWithReport for automatic packing
|
|
27
|
+
/// </summary>
|
|
28
|
+
public static void Update_BuildScript_Packing()
|
|
29
|
+
{
|
|
30
|
+
// ===== UPDATING: Build Script with Manual Packing =====
|
|
31
|
+
|
|
32
|
+
// ❌ OLD (V1 - Not recommended):
|
|
33
|
+
/*
|
|
34
|
+
[MenuItem("Tools/Build Game")]
|
|
35
|
+
public static void BuildGame()
|
|
36
|
+
{
|
|
37
|
+
// Manually pack atlases
|
|
38
|
+
var guids = AssetDatabase.FindAssets("t:SpriteAtlasAsset", new[] { "Assets" });
|
|
39
|
+
var atlases = new SpriteAtlas[guids.Length];
|
|
40
|
+
for (int i = 0; i < guids.Length; i++)
|
|
41
|
+
{
|
|
42
|
+
atlases[i] = AssetDatabase.LoadAssetAtPath<SpriteAtlas>(
|
|
43
|
+
AssetDatabase.GUIDToAssetPath(guids[i]));
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
// Manual packing before build
|
|
47
|
+
SpriteAtlasUtility.PackAtlases(atlases, EditorUserBuildSettings.activeBuildTarget);
|
|
48
|
+
|
|
49
|
+
// Then build
|
|
50
|
+
BuildPipeline.BuildPlayer(...);
|
|
51
|
+
}
|
|
52
|
+
*/
|
|
53
|
+
|
|
54
|
+
// ✅ NEW (V2 - Recommended):
|
|
55
|
+
/*
|
|
56
|
+
// Implement this as a prebuild processor instead:
|
|
57
|
+
public class AtlasPreprocessor : IPreprocessBuildWithReport
|
|
58
|
+
{
|
|
59
|
+
public int callbackOrder => 0;
|
|
60
|
+
|
|
61
|
+
public void OnPreprocessBuild(BuildTarget target, string path)
|
|
62
|
+
{
|
|
63
|
+
// Atlases are automatically packed during build
|
|
64
|
+
// Use this for generation/configuration only
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
[MenuItem("Tools/Build Game")]
|
|
69
|
+
public static void BuildGame()
|
|
70
|
+
{
|
|
71
|
+
// Just build - atlases are handled automatically
|
|
72
|
+
BuildPipeline.BuildPlayer(...);
|
|
73
|
+
}
|
|
74
|
+
*/
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
/// <summary>
|
|
78
|
+
/// OLD Pattern: Building with Addressables (REQUIRES UPDATES)
|
|
79
|
+
///
|
|
80
|
+
/// ❌ OLD CODE:
|
|
81
|
+
/// public static void BuildWithAddressables()
|
|
82
|
+
/// {
|
|
83
|
+
/// // Manually build atlases
|
|
84
|
+
/// BuildPipeline.BuildAssetBundles(...);
|
|
85
|
+
/// AddressableAssetSettings.BuildPlayerContent();
|
|
86
|
+
/// }
|
|
87
|
+
///
|
|
88
|
+
/// ✅ NEW V2 CODE:
|
|
89
|
+
/// Use IPreprocessBuildWithReport for atlas generation,
|
|
90
|
+
/// IPostprocessBuildWithReport for Addressables content building
|
|
91
|
+
/// </summary>
|
|
92
|
+
public static void Update_BuildScript_Addressables()
|
|
93
|
+
{
|
|
94
|
+
// ===== UPDATING: Build Script with Addressables =====
|
|
95
|
+
|
|
96
|
+
// ❌ OLD (V1 - Requires updates):
|
|
97
|
+
/*
|
|
98
|
+
[MenuItem("Tools/Build With Addressables")]
|
|
99
|
+
public static void BuildWithAddressables()
|
|
100
|
+
{
|
|
101
|
+
// Generate atlases
|
|
102
|
+
GenerateAtlases();
|
|
103
|
+
|
|
104
|
+
// Build asset bundles
|
|
105
|
+
BuildPipeline.BuildAssetBundles(...);
|
|
106
|
+
|
|
107
|
+
// Build addressables content
|
|
108
|
+
AddressableAssetSettings.BuildPlayerContent();
|
|
109
|
+
}
|
|
110
|
+
*/
|
|
111
|
+
|
|
112
|
+
// ✅ NEW (V2 - Recommended):
|
|
113
|
+
/*
|
|
114
|
+
// Step 1: Prebuild processor for atlas generation
|
|
115
|
+
public class AtlasPreprocessor : IPreprocessBuildWithReport
|
|
116
|
+
{
|
|
117
|
+
public void OnPreprocessBuild(BuildTarget target, string path)
|
|
118
|
+
{
|
|
119
|
+
GenerateAtlases(); // Generate atlases before build
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
// Step 2: Postprocess processor for Addressables
|
|
124
|
+
public class AddressablesPostprocessor : IPostprocessBuildWithReport
|
|
125
|
+
{
|
|
126
|
+
public void OnPostprocessBuild(BuildTarget target, string path)
|
|
127
|
+
{
|
|
128
|
+
AddressableAssetSettings.BuildPlayerContent();
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
// Step 3: Simple build script
|
|
133
|
+
[MenuItem("Tools/Build With Addressables")]
|
|
134
|
+
public static void BuildWithAddressables()
|
|
135
|
+
{
|
|
136
|
+
// Atlases and addressables are handled automatically
|
|
137
|
+
BuildPipeline.BuildPlayer(...);
|
|
138
|
+
}
|
|
139
|
+
*/
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
/// <summary>
|
|
143
|
+
/// Complete example: Updated build pipeline with prebuild.
|
|
144
|
+
/// </summary>
|
|
145
|
+
public static void Complete_UpdatedBuildPipeline()
|
|
146
|
+
{
|
|
147
|
+
// ===== COMPLETE: Updated Build Pipeline (V2) =====
|
|
148
|
+
|
|
149
|
+
/*
|
|
150
|
+
// ============================================
|
|
151
|
+
// PREBUILD: Generate atlases automatically
|
|
152
|
+
// ============================================
|
|
153
|
+
|
|
154
|
+
public class AtlasPreprocessor : IPreprocessBuildWithReport
|
|
155
|
+
{
|
|
156
|
+
public int callbackOrder => 0;
|
|
157
|
+
|
|
158
|
+
public void OnPreprocessBuild(BuildTarget target, string path)
|
|
159
|
+
{
|
|
160
|
+
Debug.Log("Generating atlases before build...");
|
|
161
|
+
|
|
162
|
+
// Find all sprite folders
|
|
163
|
+
var folderConfigs = new[]
|
|
164
|
+
{
|
|
165
|
+
new { Folder = "Assets/Art/UI", Output = "Assets/Atlases/UI.spriteatlasv2" },
|
|
166
|
+
new { Folder = "Assets/Art/Characters", Output = "Assets/Atlases/Characters.spriteatlasv2" }
|
|
167
|
+
};
|
|
168
|
+
|
|
169
|
+
foreach (var config in folderConfigs)
|
|
170
|
+
{
|
|
171
|
+
GenerateAtlasByFolder(config.Folder, config.Output);
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
Debug.Log("Atlas generation complete.");
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
private void GenerateAtlasByFolder(string folderPath, string outputPath)
|
|
178
|
+
{
|
|
179
|
+
// Find sprites in folder
|
|
180
|
+
var guids = AssetDatabase.FindAssets("t:Sprite", new[] { folderPath });
|
|
181
|
+
|
|
182
|
+
// Load sprites
|
|
183
|
+
var sprites = new Object[guids.Length];
|
|
184
|
+
for (int i = 0; i < guids.Length; i++)
|
|
185
|
+
{
|
|
186
|
+
sprites[i] = AssetDatabase.LoadAssetAtPath<Sprite>(
|
|
187
|
+
AssetDatabase.GUIDToAssetPath(guids[i]));
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
// Create atlas asset
|
|
191
|
+
var asset = new SpriteAtlasAsset();
|
|
192
|
+
asset.Add(sprites);
|
|
193
|
+
|
|
194
|
+
// Save and import
|
|
195
|
+
SpriteAtlasAsset.Save(asset, outputPath);
|
|
196
|
+
AssetDatabase.ImportAsset(outputPath);
|
|
197
|
+
|
|
198
|
+
// Configure via importer
|
|
199
|
+
var importer = AssetImporter.GetAtPath(outputPath) as SpriteAtlasImporter;
|
|
200
|
+
if (importer != null)
|
|
201
|
+
{
|
|
202
|
+
importer.includeInBuild = true;
|
|
203
|
+
importer.packingSettings.tightPacking = true;
|
|
204
|
+
importer.SaveAndReimport();
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
// ============================================
|
|
210
|
+
// BUILD: Simple build script
|
|
211
|
+
// ============================================
|
|
212
|
+
|
|
213
|
+
[MenuItem("Tools/Build Game")]
|
|
214
|
+
public static void BuildGame()
|
|
215
|
+
{
|
|
216
|
+
Debug.Log("Starting build...");
|
|
217
|
+
|
|
218
|
+
// Atlases are automatically generated by preprocessor
|
|
219
|
+
// No manual packing needed!
|
|
220
|
+
|
|
221
|
+
var buildResult = BuildPipeline.BuildPlayer(GetBuildOptions());
|
|
222
|
+
if (buildResult.summary.result == BuildResult.Succeeded)
|
|
223
|
+
{
|
|
224
|
+
Debug.Log($"Build succeeded: {buildResult.outputPath}");
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
private static BuildPlayerOptions GetBuildOptions()
|
|
229
|
+
{
|
|
230
|
+
return new BuildPlayerOptions
|
|
231
|
+
{
|
|
232
|
+
scenes = EditorBuildSettings.scenes,
|
|
233
|
+
locationPathName = "Builds/Game.exe",
|
|
234
|
+
target = EditorUserBuildSettings.activeBuildTarget,
|
|
235
|
+
options = BuildOptions.None
|
|
236
|
+
};
|
|
237
|
+
}
|
|
238
|
+
*/
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
/// <summary>
|
|
242
|
+
/// Migration checklist for build scripts:
|
|
243
|
+
///
|
|
244
|
+
/// [ ] Remove manual SpriteAtlasUtility.PackAtlases() calls
|
|
245
|
+
/// [ ] Implement IPreprocessBuildWithReport for atlas generation
|
|
246
|
+
/// [ ] Use IPostprocessBuildWithReport for post-build steps (Addressables, etc.)
|
|
247
|
+
/// [ ] Simplify build scripts - most work is now automated
|
|
248
|
+
/// </summary>
|
|
249
|
+
public static void Migration_Checklist()
|
|
250
|
+
{
|
|
251
|
+
/*
|
|
252
|
+
MIGRATION CHECKLIST:
|
|
253
|
+
====================
|
|
254
|
+
|
|
255
|
+
1. Remove Manual Packing
|
|
256
|
+
- OLD: SpriteAtlasUtility.PackAtlases() in build script
|
|
257
|
+
- NEW: Automatic during build (remove manual calls)
|
|
258
|
+
|
|
259
|
+
2. Add Prebuild Processor
|
|
260
|
+
- Implement IPreprocessBuildWithReport.OnPreprocessBuild()
|
|
261
|
+
- Generate or update atlases here
|
|
262
|
+
|
|
263
|
+
3. Add Postbuild Processor (if needed)
|
|
264
|
+
- Implement IPostprocessBuildWithReport.OnPostprocessBuild()
|
|
265
|
+
- Handle Addressables, asset bundles, etc.
|
|
266
|
+
|
|
267
|
+
4. Simplify Build Script
|
|
268
|
+
- Remove manual atlas generation/packing
|
|
269
|
+
- Just call BuildPipeline.BuildPlayer()
|
|
270
|
+
|
|
271
|
+
5. Test Build Pipeline
|
|
272
|
+
- Verify atlases are generated before build
|
|
273
|
+
- Check that atlases are included in build output
|
|
274
|
+
*/
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
/// <summary>
|
|
279
|
+
/// Example: Complete prebuild processor for atlas generation.
|
|
280
|
+
/// </summary>
|
|
281
|
+
public class CompletePreprocessor : IPreprocessBuildWithReport
|
|
282
|
+
{
|
|
283
|
+
public int callbackOrder => 0;
|
|
284
|
+
public void OnPreprocessBuild(BuildReport report)
|
|
285
|
+
{
|
|
286
|
+
Debug.Log($"[AtlasPreprocessor] Generating atlases...");
|
|
287
|
+
|
|
288
|
+
// Generate atlases by folder
|
|
289
|
+
GenerateAtlasByFolder("Assets/Art/UI", "Assets/Atlases/UI.spriteatlasv2");
|
|
290
|
+
GenerateAtlasByFolder("Assets/Art/Characters", "Assets/Atlases/Characters.spriteatlasv2");
|
|
291
|
+
|
|
292
|
+
Debug.Log("[AtlasPreprocessor] Atlas generation complete.");
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
private void GenerateAtlasByFolder(string folderPath, string outputPath)
|
|
296
|
+
{
|
|
297
|
+
// Find sprites in folder
|
|
298
|
+
var guids = AssetDatabase.FindAssets("t:Sprite", new[] { folderPath });
|
|
299
|
+
|
|
300
|
+
if (guids.Length == 0)
|
|
301
|
+
return;
|
|
302
|
+
|
|
303
|
+
Debug.Log($"[AtlasPreprocessor] Found {guids.Length} sprites in {folderPath}");
|
|
304
|
+
|
|
305
|
+
// Load sprites
|
|
306
|
+
var sprites = new Object[guids.Length];
|
|
307
|
+
for (int i = 0; i < guids.Length; i++)
|
|
308
|
+
{
|
|
309
|
+
sprites[i] = AssetDatabase.LoadAssetAtPath<Sprite>(
|
|
310
|
+
AssetDatabase.GUIDToAssetPath(guids[i]));
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
// Create or update atlas asset
|
|
314
|
+
SpriteAtlasAsset asset;
|
|
315
|
+
if (System.IO.File.Exists(outputPath))
|
|
316
|
+
{
|
|
317
|
+
asset = AssetDatabase.LoadAssetAtPath<SpriteAtlasAsset>(outputPath);
|
|
318
|
+
}
|
|
319
|
+
else
|
|
320
|
+
{
|
|
321
|
+
asset = new SpriteAtlasAsset();
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
asset.Add(sprites);
|
|
325
|
+
|
|
326
|
+
// Save and import
|
|
327
|
+
SpriteAtlasAsset.Save(asset, outputPath);
|
|
328
|
+
AssetDatabase.ImportAsset(outputPath);
|
|
329
|
+
|
|
330
|
+
// Configure via importer
|
|
331
|
+
var importer = AssetImporter.GetAtPath(outputPath) as SpriteAtlasImporter;
|
|
332
|
+
if (importer != null)
|
|
333
|
+
{
|
|
334
|
+
importer.includeInBuild = true;
|
|
335
|
+
var packingSettings = importer.packingSettings;
|
|
336
|
+
packingSettings.enableTightPacking = true;
|
|
337
|
+
importer.packingSettings = packingSettings;
|
|
338
|
+
|
|
339
|
+
// Platform-specific settings
|
|
340
|
+
importer.SetPlatformSettings(new TextureImporterPlatformSettings
|
|
341
|
+
{
|
|
342
|
+
name = "Android",
|
|
343
|
+
maxTextureSize = 1024,
|
|
344
|
+
format = TextureImporterFormat.ETC2_RGB4
|
|
345
|
+
});
|
|
346
|
+
|
|
347
|
+
importer.SetPlatformSettings(new TextureImporterPlatformSettings
|
|
348
|
+
{
|
|
349
|
+
name = "Standalone",
|
|
350
|
+
maxTextureSize = 2048,
|
|
351
|
+
format = TextureImporterFormat.DXT5
|
|
352
|
+
});
|
|
353
|
+
|
|
354
|
+
importer.SaveAndReimport();
|
|
355
|
+
}
|
|
356
|
+
}
|
|
357
|
+
}
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
// [UNITY-SKILL:SPRITEATLAS]
|
|
2
|
+
using UnityEditor;
|
|
3
|
+
using UnityEditor.U2D;
|
|
4
|
+
using UnityEngine;
|
|
5
|
+
|
|
6
|
+
/// <summary>
|
|
7
|
+
/// Demonstrates updating settings configuration for SpriteAtlases.
|
|
8
|
+
/// Shows how to migrate from old configuration patterns to V2.
|
|
9
|
+
/// </summary>
|
|
10
|
+
public static class UpdateSettingsConfigurationDocumentation
|
|
11
|
+
{
|
|
12
|
+
/// <summary>
|
|
13
|
+
/// OLD V1 Pattern: Using SetBuildSettings (NO LONGER AVAILABLE)
|
|
14
|
+
///
|
|
15
|
+
/// ❌ OLD CODE:
|
|
16
|
+
/// var importer = (SpriteAtlasImporter)AssetImporter.GetAtPath(path);
|
|
17
|
+
/// importer.SetBuildSettings(settings);
|
|
18
|
+
///
|
|
19
|
+
/// ✅ NEW V2 CODE:
|
|
20
|
+
/// var importer = (SpriteAtlasImporter)AssetImporter.GetAtPath(path);
|
|
21
|
+
/// importer.packingSettings = settings;
|
|
22
|
+
/// importer.SaveAndReimport();
|
|
23
|
+
/// </summary>
|
|
24
|
+
public static void Update_PackingSettings()
|
|
25
|
+
{
|
|
26
|
+
// ===== UPDATING: Packing Settings =====
|
|
27
|
+
|
|
28
|
+
string path = "Assets/MyAtlas.spriteatlasv2";
|
|
29
|
+
|
|
30
|
+
// ❌ OLD (V1 - Method removed):
|
|
31
|
+
/*
|
|
32
|
+
var importer = (SpriteAtlasImporter)AssetImporter.GetAtPath(path);
|
|
33
|
+
importer.SetBuildSettings(settings); // Compile error!
|
|
34
|
+
*/
|
|
35
|
+
|
|
36
|
+
// ✅ NEW (V2):
|
|
37
|
+
SpriteAtlasImporter importer = AssetImporter.GetAtPath(path) as SpriteAtlasImporter;
|
|
38
|
+
if (importer != null)
|
|
39
|
+
{
|
|
40
|
+
var packingSettings = importer.packingSettings;
|
|
41
|
+
packingSettings.padding = 2;
|
|
42
|
+
packingSettings.enableTightPacking = true;
|
|
43
|
+
packingSettings.enableRotation = true;
|
|
44
|
+
importer.packingSettings = packingSettings;
|
|
45
|
+
|
|
46
|
+
// ✅ CRITICAL: Save and reimport
|
|
47
|
+
importer.SaveAndReimport();
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
/// <summary>
|
|
52
|
+
/// OLD V1 Pattern: Direct texture settings modification (CHANGED)
|
|
53
|
+
///
|
|
54
|
+
/// ❌ OLD CODE:
|
|
55
|
+
/// var importer = (SpriteAtlasImporter)AssetImporter.GetAtPath(path);
|
|
56
|
+
/// importer.textureSettings.filterMode = FilterMode.Trilinear;
|
|
57
|
+
///
|
|
58
|
+
/// ✅ NEW V2 CODE:
|
|
59
|
+
/// Use SetPlatformTextureSettings() for platform-specific settings
|
|
60
|
+
/// </summary>
|
|
61
|
+
public static void Update_TextureSettings()
|
|
62
|
+
{
|
|
63
|
+
// ===== UPDATING: Texture Settings =====
|
|
64
|
+
|
|
65
|
+
string path = "Assets/MyAtlas.spriteatlasv2";
|
|
66
|
+
|
|
67
|
+
SpriteAtlasImporter importer = AssetImporter.GetAtPath(path) as SpriteAtlasImporter;
|
|
68
|
+
if (importer != null)
|
|
69
|
+
{
|
|
70
|
+
// ✅ NEW: Use platform-specific texture settings
|
|
71
|
+
importer.SetPlatformSettings(new TextureImporterPlatformSettings
|
|
72
|
+
{
|
|
73
|
+
name = "Standalone",
|
|
74
|
+
maxTextureSize = 1024,
|
|
75
|
+
format = TextureImporterFormat.DXT5,
|
|
76
|
+
compressionQuality = 100
|
|
77
|
+
});
|
|
78
|
+
|
|
79
|
+
// ✅ CRITICAL: Save and reimport
|
|
80
|
+
importer.SaveAndReimport();
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
/// <summary>
|
|
85
|
+
/// OLD V1 Pattern: Platform settings (RESTRUCTURED)
|
|
86
|
+
///
|
|
87
|
+
/// ❌ OLD CODE:
|
|
88
|
+
/// var importer = (SpriteAtlasImporter)AssetImporter.GetAtPath(path);
|
|
89
|
+
/// importer.platformSettings.maxTextureSize = 1024;
|
|
90
|
+
///
|
|
91
|
+
/// ✅ NEW V2 CODE:
|
|
92
|
+
/// Use SetPlatformTextureSettings() for each platform
|
|
93
|
+
/// </summary>
|
|
94
|
+
public static void Update_PlatformSettings()
|
|
95
|
+
{
|
|
96
|
+
// ===== UPDATING: Platform Settings =====
|
|
97
|
+
|
|
98
|
+
string path = "Assets/MyAtlas.spriteatlasv2";
|
|
99
|
+
|
|
100
|
+
SpriteAtlasImporter importer = AssetImporter.GetAtPath(path) as SpriteAtlasImporter;
|
|
101
|
+
if (importer != null)
|
|
102
|
+
{
|
|
103
|
+
// ✅ NEW: Set platform-specific settings
|
|
104
|
+
// Mobile platform (Android/iOS)
|
|
105
|
+
importer.SetPlatformSettings(new TextureImporterPlatformSettings
|
|
106
|
+
{
|
|
107
|
+
name = "Android",
|
|
108
|
+
maxTextureSize = 1024,
|
|
109
|
+
format = TextureImporterFormat.ETC2_RGB4,
|
|
110
|
+
compressionQuality = 100
|
|
111
|
+
});
|
|
112
|
+
|
|
113
|
+
// IOS
|
|
114
|
+
importer.SetPlatformSettings(new TextureImporterPlatformSettings
|
|
115
|
+
{
|
|
116
|
+
name = "iOS",
|
|
117
|
+
maxTextureSize = 1024,
|
|
118
|
+
format = TextureImporterFormat.ASTC_6x6,
|
|
119
|
+
compressionQuality = 100
|
|
120
|
+
});
|
|
121
|
+
|
|
122
|
+
// Desktop platform (Windows/Mac/Linux)
|
|
123
|
+
importer.SetPlatformSettings(new TextureImporterPlatformSettings
|
|
124
|
+
{
|
|
125
|
+
name = "Standalone",
|
|
126
|
+
maxTextureSize = 1024,
|
|
127
|
+
format = TextureImporterFormat.DXT5,
|
|
128
|
+
compressionQuality = 100
|
|
129
|
+
});
|
|
130
|
+
|
|
131
|
+
// ✅ CRITICAL: Save and reimport
|
|
132
|
+
importer.SaveAndReimport();
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
}
|
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
// [UNITY-SKILL:SPRITEATLAS]
|
|
2
|
+
using UnityEditor;
|
|
3
|
+
using UnityEditor.U2D;
|
|
4
|
+
using UnityEngine;
|
|
5
|
+
using UnityEngine.U2D;
|
|
6
|
+
|
|
7
|
+
/// <summary>
|
|
8
|
+
/// Demonstrates using SpriteAtlas variants wisely.
|
|
9
|
+
/// Variants allow different atlases for different platforms or resolutions.
|
|
10
|
+
/// </summary>
|
|
11
|
+
public static class UseVariantsWiselyExample
|
|
12
|
+
{
|
|
13
|
+
/// <summary>
|
|
14
|
+
/// Creates a variant atlas from a master atlas.
|
|
15
|
+
/// Variants inherit settings from the master but can override texture formats.
|
|
16
|
+
/// </summary>
|
|
17
|
+
public static void CreateVariantAtlas(string masterPath, string variantPath)
|
|
18
|
+
{
|
|
19
|
+
// Load the master atlas (runtime type)
|
|
20
|
+
SpriteAtlas masterAtlas = AssetDatabase.LoadAssetAtPath<SpriteAtlas>(masterPath);
|
|
21
|
+
|
|
22
|
+
if (masterAtlas == null)
|
|
23
|
+
{
|
|
24
|
+
Debug.LogError($"Could not load master atlas at {masterPath}");
|
|
25
|
+
return;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
// Create variant asset
|
|
29
|
+
SpriteAtlasAsset variantAsset = new SpriteAtlasAsset();
|
|
30
|
+
variantAsset.SetMasterAtlas(masterAtlas); // Link to master
|
|
31
|
+
|
|
32
|
+
// Add sprites from master (optional - variants can use same packables)
|
|
33
|
+
Object[] masterPackables = masterAtlas.GetPackables();
|
|
34
|
+
variantAsset.Add(masterPackables);
|
|
35
|
+
|
|
36
|
+
// Save variant
|
|
37
|
+
SpriteAtlasAsset.Save(variantAsset, variantPath);
|
|
38
|
+
AssetDatabase.ImportAsset(variantPath);
|
|
39
|
+
|
|
40
|
+
Debug.Log($"Created variant atlas at {variantPath}");
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/// <summary>
|
|
44
|
+
/// Configures platform-specific variants for different quality levels.
|
|
45
|
+
/// High-quality variant for desktop, low-quality for mobile.
|
|
46
|
+
/// </summary>
|
|
47
|
+
public static void CreateQualityVariants(string masterPath)
|
|
48
|
+
{
|
|
49
|
+
// Create high-quality variant
|
|
50
|
+
string highVariantPath = masterPath.Replace(".spriteatlasv2", "_HQ.spriteatlasv2");
|
|
51
|
+
ConfigureVariantForPlatform(highVariantPath, "Standalone", 2048, TextureImporterFormat.ASTC_6x6);
|
|
52
|
+
|
|
53
|
+
// Create low-quality variant for mobile
|
|
54
|
+
string lowVariantPath = masterPath.Replace(".spriteatlasv2", "_LQ.spriteatlasv2");
|
|
55
|
+
ConfigureVariantForPlatform(lowVariantPath, "Android", 1024, TextureImporterFormat.ASTC_6x6);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
/// <summary>
|
|
59
|
+
/// Configures a variant for a specific platform with given settings.
|
|
60
|
+
/// </summary>
|
|
61
|
+
private static void ConfigureVariantForPlatform(string variantPath, string platformName, int maxTextureSize, TextureImporterFormat format)
|
|
62
|
+
{
|
|
63
|
+
SpriteAtlasImporter importer = AssetImporter.GetAtPath(variantPath) as SpriteAtlasImporter;
|
|
64
|
+
if (importer == null)
|
|
65
|
+
return;
|
|
66
|
+
|
|
67
|
+
// Configure platform-specific settings
|
|
68
|
+
importer.SetPlatformSettings(new TextureImporterPlatformSettings
|
|
69
|
+
{
|
|
70
|
+
name = platformName,
|
|
71
|
+
maxTextureSize = maxTextureSize,
|
|
72
|
+
format = format,
|
|
73
|
+
compressionQuality = 50
|
|
74
|
+
});
|
|
75
|
+
|
|
76
|
+
importer.SaveAndReimport();
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
/// <summary>
|
|
80
|
+
/// Creates resolution variants for different screen sizes.
|
|
81
|
+
/// Example: 1x, 2x, and 3x variants for different DPI support.
|
|
82
|
+
/// </summary>
|
|
83
|
+
public static void CreateResolutionVariants(string masterPath)
|
|
84
|
+
{
|
|
85
|
+
// Create 2x variant
|
|
86
|
+
string x2Path = masterPath.Replace(".spriteatlasv2", "_2x.spriteatlasv2");
|
|
87
|
+
SpriteAtlasImporter importerX2 = CreateVariantImporter(x2Path);
|
|
88
|
+
if (importerX2 != null)
|
|
89
|
+
{
|
|
90
|
+
importerX2.variantScale = 2.0f;
|
|
91
|
+
importerX2.SaveAndReimport();
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
// Create 3x variant
|
|
95
|
+
string x3Path = masterPath.Replace(".spriteatlasv2", "_3x.spriteatlasv2");
|
|
96
|
+
SpriteAtlasImporter importerX3 = CreateVariantImporter(x3Path);
|
|
97
|
+
if (importerX3 != null)
|
|
98
|
+
{
|
|
99
|
+
importerX3.variantScale = 3.0f;
|
|
100
|
+
importerX3.SaveAndReimport();
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
/// <summary>
|
|
105
|
+
/// Creates a variant importer for a new variant atlas.
|
|
106
|
+
/// </summary>
|
|
107
|
+
private static SpriteAtlasImporter CreateVariantImporter(string path)
|
|
108
|
+
{
|
|
109
|
+
// Check if file exists
|
|
110
|
+
if (!System.IO.File.Exists(path))
|
|
111
|
+
{
|
|
112
|
+
Debug.LogWarning($"Variant file does not exist: {path}");
|
|
113
|
+
return null;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
return AssetImporter.GetAtPath(path) as SpriteAtlasImporter;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
/// <summary>
|
|
120
|
+
/// Gets the appropriate variant for a given platform.
|
|
121
|
+
/// Use this at runtime to load the correct variant.
|
|
122
|
+
/// </summary>
|
|
123
|
+
public static string GetVariantForPlatform(string masterPath, BuildTarget target)
|
|
124
|
+
{
|
|
125
|
+
switch (target)
|
|
126
|
+
{
|
|
127
|
+
case BuildTarget.StandaloneWindows:
|
|
128
|
+
case BuildTarget.StandaloneOSX:
|
|
129
|
+
case BuildTarget.StandaloneLinux64:
|
|
130
|
+
// Desktop - use high quality
|
|
131
|
+
return masterPath.Replace(".spriteatlasv2", "_HQ.spriteatlasv2");
|
|
132
|
+
case BuildTarget.Android:
|
|
133
|
+
case BuildTarget.iOS:
|
|
134
|
+
case BuildTarget.WebGL:
|
|
135
|
+
// Mobile - use optimized
|
|
136
|
+
return masterPath.Replace(".spriteatlasv2", "_LQ.spriteatlasv2");
|
|
137
|
+
default:
|
|
138
|
+
return masterPath; // Use master for unknown platforms
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
/// <summary>
|
|
143
|
+
/// Cleans up unused variant atlases.
|
|
144
|
+
/// Remove variants that are no longer needed.
|
|
145
|
+
/// </summary>
|
|
146
|
+
public static void CleanupUnusedVariants(string folderPath)
|
|
147
|
+
{
|
|
148
|
+
string[] guids = AssetDatabase.FindAssets("t:SpriteAtlasAsset", new[] { folderPath });
|
|
149
|
+
|
|
150
|
+
foreach (string guid in guids)
|
|
151
|
+
{
|
|
152
|
+
string path = AssetDatabase.GUIDToAssetPath(guid);
|
|
153
|
+
|
|
154
|
+
// Check if this is a variant (has quality suffix)
|
|
155
|
+
if (path.Contains("_HQ") || path.Contains("_LQ") || path.Contains("_2x") || path.Contains("_3x"))
|
|
156
|
+
{
|
|
157
|
+
Debug.Log($"Checking variant: {path}");
|
|
158
|
+
// Add cleanup logic here as needed
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
/// <summary>
|
|
165
|
+
/// Component that loads the appropriate atlas variant at runtime.
|
|
166
|
+
/// </summary>
|
|
167
|
+
public class VariantAtlasLoader : MonoBehaviour
|
|
168
|
+
{
|
|
169
|
+
[SerializeField] private string _masterAtlasPath = "Atlases/MyAtlas.spriteatlasv2";
|
|
170
|
+
|
|
171
|
+
private void Start()
|
|
172
|
+
{
|
|
173
|
+
BuildTarget target = EditorUserBuildSettings.activeBuildTarget;
|
|
174
|
+
string variantPath = UseVariantsWiselyExample.GetVariantForPlatform(_masterAtlasPath, target);
|
|
175
|
+
|
|
176
|
+
Debug.Log($"Loading variant for {target}: {variantPath}");
|
|
177
|
+
// Load the appropriate variant...
|
|
178
|
+
}
|
|
179
|
+
}
|