@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,148 @@
|
|
|
1
|
+
// Code template for creating Tile Palettes using GridPaletteUtility.CreateNewPalette
|
|
2
|
+
// Reference: Packages/com.unity.2d.tilemap/Editor/GridPaletteUtility.cs
|
|
3
|
+
|
|
4
|
+
using UnityEngine;
|
|
5
|
+
using UnityEditor.Tilemaps;
|
|
6
|
+
|
|
7
|
+
namespace TilePaletteCreation
|
|
8
|
+
{
|
|
9
|
+
public static class CreatePaletteTemplate
|
|
10
|
+
{
|
|
11
|
+
// CreateNewPalette signature:
|
|
12
|
+
// public static GameObject CreateNewPalette(
|
|
13
|
+
// string folderPath,
|
|
14
|
+
// string name,
|
|
15
|
+
// GridLayout.CellLayout layout,
|
|
16
|
+
// GridPalette.CellSizing cellSizing,
|
|
17
|
+
// Vector3 cellSize,
|
|
18
|
+
// GridLayout.CellSwizzle swizzle,
|
|
19
|
+
// TransparencySortMode sortMode,
|
|
20
|
+
// Vector3 sortAxis)
|
|
21
|
+
|
|
22
|
+
/// <summary>
|
|
23
|
+
/// Creates a rectangular tile palette with automatic cell sizing.
|
|
24
|
+
/// </summary>
|
|
25
|
+
public static GameObject CreateRectangularPalette(string folderPath, string paletteName)
|
|
26
|
+
{
|
|
27
|
+
return GridPaletteUtility.CreateNewPalette(
|
|
28
|
+
folderPath,
|
|
29
|
+
paletteName,
|
|
30
|
+
GridLayout.CellLayout.Rectangle,
|
|
31
|
+
GridPalette.CellSizing.Automatic,
|
|
32
|
+
new Vector3(1f, 1f, 0f),
|
|
33
|
+
GridLayout.CellSwizzle.XYZ,
|
|
34
|
+
TransparencySortMode.Default,
|
|
35
|
+
new Vector3(0f, 0f, 1f));
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/// <summary>
|
|
39
|
+
/// Creates a hexagonal tile palette (point-top orientation).
|
|
40
|
+
/// Uses the standard hexagonal cell size.
|
|
41
|
+
/// </summary>
|
|
42
|
+
public static GameObject CreateHexagonalPalette(string folderPath, string paletteName)
|
|
43
|
+
{
|
|
44
|
+
return GridPaletteUtility.CreateNewPalette(
|
|
45
|
+
folderPath,
|
|
46
|
+
paletteName,
|
|
47
|
+
GridLayout.CellLayout.Hexagon,
|
|
48
|
+
GridPalette.CellSizing.Manual,
|
|
49
|
+
new Vector3(0.8659766f, 1f, 1f),
|
|
50
|
+
GridLayout.CellSwizzle.XYZ,
|
|
51
|
+
TransparencySortMode.Default,
|
|
52
|
+
new Vector3(0f, 0f, 1f));
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
/// <summary>
|
|
56
|
+
/// Creates an isometric tile palette with custom sort axis.
|
|
57
|
+
/// </summary>
|
|
58
|
+
public static GameObject CreateIsometricPalette(string folderPath, string paletteName)
|
|
59
|
+
{
|
|
60
|
+
return GridPaletteUtility.CreateNewPalette(
|
|
61
|
+
folderPath,
|
|
62
|
+
paletteName,
|
|
63
|
+
GridLayout.CellLayout.Isometric,
|
|
64
|
+
GridPalette.CellSizing.Manual,
|
|
65
|
+
new Vector3(1f, 0.5f, 1f),
|
|
66
|
+
GridLayout.CellSwizzle.XYZ,
|
|
67
|
+
TransparencySortMode.CustomAxis,
|
|
68
|
+
new Vector3(0f, 0f, 1f));
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
/// <summary>
|
|
72
|
+
/// Creates an isometric Z as Y tile palette.
|
|
73
|
+
/// Used when Z position should affect Y sorting.
|
|
74
|
+
/// </summary>
|
|
75
|
+
public static GameObject CreateIsometricZAsYPalette(string folderPath, string paletteName)
|
|
76
|
+
{
|
|
77
|
+
return GridPaletteUtility.CreateNewPalette(
|
|
78
|
+
folderPath,
|
|
79
|
+
paletteName,
|
|
80
|
+
GridLayout.CellLayout.IsometricZAsY,
|
|
81
|
+
GridPalette.CellSizing.Manual,
|
|
82
|
+
new Vector3(1f, 0.5f, 1f),
|
|
83
|
+
GridLayout.CellSwizzle.XYZ,
|
|
84
|
+
TransparencySortMode.CustomAxis,
|
|
85
|
+
new Vector3(0f, 0f, 1f));
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
/// <summary>
|
|
89
|
+
/// Creates a tile palette with fully customizable parameters.
|
|
90
|
+
/// </summary>
|
|
91
|
+
/// <param name="folderPath">Project-relative folder path (e.g., "Assets/Palettes")</param>
|
|
92
|
+
/// <param name="paletteName">Name of the palette asset</param>
|
|
93
|
+
/// <param name="layout">Grid cell layout type</param>
|
|
94
|
+
/// <param name="cellSizing">Automatic or Manual cell sizing</param>
|
|
95
|
+
/// <param name="cellSize">Size of each cell in the grid</param>
|
|
96
|
+
/// <param name="swizzle">Cell coordinate swizzle</param>
|
|
97
|
+
/// <param name="sortMode">Transparency sort mode for rendering</param>
|
|
98
|
+
/// <param name="sortAxis">Custom sort axis (used when sortMode is CustomAxis)</param>
|
|
99
|
+
/// <returns>The created palette GameObject, or null if creation failed</returns>
|
|
100
|
+
public static GameObject CreateCustomPalette(
|
|
101
|
+
string folderPath,
|
|
102
|
+
string paletteName,
|
|
103
|
+
GridLayout.CellLayout layout,
|
|
104
|
+
GridPalette.CellSizing cellSizing,
|
|
105
|
+
Vector3 cellSize,
|
|
106
|
+
GridLayout.CellSwizzle swizzle,
|
|
107
|
+
TransparencySortMode sortMode,
|
|
108
|
+
Vector3 sortAxis)
|
|
109
|
+
{
|
|
110
|
+
return GridPaletteUtility.CreateNewPalette(
|
|
111
|
+
folderPath,
|
|
112
|
+
paletteName,
|
|
113
|
+
layout,
|
|
114
|
+
cellSizing,
|
|
115
|
+
cellSize,
|
|
116
|
+
swizzle,
|
|
117
|
+
sortMode,
|
|
118
|
+
sortAxis);
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
// Parameter Reference:
|
|
124
|
+
//
|
|
125
|
+
// GridLayout.CellLayout:
|
|
126
|
+
// - Rectangle: Standard rectangular grid
|
|
127
|
+
// - Hexagon: Hexagonal grid
|
|
128
|
+
// - Isometric: Isometric grid
|
|
129
|
+
// - IsometricZAsY: Isometric grid where Z position affects Y sorting
|
|
130
|
+
//
|
|
131
|
+
// GridPalette.CellSizing:
|
|
132
|
+
// - Automatic: Cell size determined automatically from sprites
|
|
133
|
+
// - Manual: Cell size specified explicitly
|
|
134
|
+
//
|
|
135
|
+
// GridLayout.CellSwizzle:
|
|
136
|
+
// - XYZ: Standard coordinate system
|
|
137
|
+
// - XZY, YXZ, YZX, ZXY, ZYX: Various coordinate swizzles
|
|
138
|
+
//
|
|
139
|
+
// TransparencySortMode:
|
|
140
|
+
// - Default: Use default sorting
|
|
141
|
+
// - Perspective: Sort by perspective
|
|
142
|
+
// - Orthographic: Sort orthographically
|
|
143
|
+
// - CustomAxis: Sort along a custom axis
|
|
144
|
+
//
|
|
145
|
+
// Recommended Cell Sizes:
|
|
146
|
+
// - Rectangular: (1, 1, 0) with Automatic sizing
|
|
147
|
+
// - Hexagonal: (0.8659766, 1, 1)
|
|
148
|
+
// - Isometric: (1, 0.5, 1)
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
using System.Collections.Generic;
|
|
2
|
+
using System.Linq;
|
|
3
|
+
using UnityEngine;
|
|
4
|
+
|
|
5
|
+
/// <summary>
|
|
6
|
+
/// Example: Manual two-step workflow for more control over the analysis step.
|
|
7
|
+
/// </summary>
|
|
8
|
+
public static class ManualWorkflowExample
|
|
9
|
+
{
|
|
10
|
+
public static void RunManualWorkflow(List<Sprite> sprites, RuleTile myRuleTile,
|
|
11
|
+
bool filterToKnownPatterns = true)
|
|
12
|
+
{
|
|
13
|
+
// Step 1: Run sprite-segment-3x3grid on each sprite, filter, and deduplicate
|
|
14
|
+
var seenPatterns = new HashSet<string>();
|
|
15
|
+
var uniquePatterns = new List<(string pattern, Sprite sprite)>();
|
|
16
|
+
|
|
17
|
+
foreach (var sprite in sprites)
|
|
18
|
+
{
|
|
19
|
+
// Apply sprite-segment-3x3grid analysis
|
|
20
|
+
string pattern = SpriteSegment3x3Grid.AnalyzeSpriteGrid(
|
|
21
|
+
sprite,
|
|
22
|
+
matchThreshold: 0.75f,
|
|
23
|
+
colorTolerance: 0.04f
|
|
24
|
+
);
|
|
25
|
+
|
|
26
|
+
// Discard patterns not in the known set
|
|
27
|
+
if (filterToKnownPatterns &&
|
|
28
|
+
!TilemapRuleTileCreateFromSegment.IsKnownPattern(pattern))
|
|
29
|
+
{
|
|
30
|
+
Debug.Log($"Sprite '{sprite.name}' skipped (unknown pattern: {pattern})");
|
|
31
|
+
continue;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
// Skip duplicates
|
|
35
|
+
if (seenPatterns.Contains(pattern))
|
|
36
|
+
{
|
|
37
|
+
Debug.Log($"Sprite '{sprite.name}' skipped (duplicate pattern: {pattern})");
|
|
38
|
+
continue;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
seenPatterns.Add(pattern);
|
|
42
|
+
Debug.Log($"Sprite '{sprite.name}' pattern: {pattern}");
|
|
43
|
+
uniquePatterns.Add((pattern, sprite));
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
// Step 2: Create TilingRules from unique patterns
|
|
47
|
+
var rules = new List<(RuleTile.TilingRule rule, int specificity)>();
|
|
48
|
+
foreach (var (pattern, sprite) in uniquePatterns)
|
|
49
|
+
{
|
|
50
|
+
var result = TilemapRuleTileCreateFromSegment.CreateTilingRuleFromPattern(pattern, sprite);
|
|
51
|
+
rules.Add(result);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
// Sort by specificity
|
|
55
|
+
rules.Sort((a, b) => b.specificity.CompareTo(a.specificity));
|
|
56
|
+
|
|
57
|
+
// Apply to RuleTile
|
|
58
|
+
var sortedRules = rules.Select(r => r.rule).ToList();
|
|
59
|
+
TilemapRuleTileCreateFromSegment.ApplyRulesToTile(myRuleTile, sortedRules);
|
|
60
|
+
|
|
61
|
+
Debug.Log($"Created {sortedRules.Count} unique rules from {sprites.Count} sprites");
|
|
62
|
+
}
|
|
63
|
+
}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
using System.Linq;
|
|
2
|
+
using UnityEditor;
|
|
3
|
+
using UnityEngine;
|
|
4
|
+
|
|
5
|
+
public class RuleTileGenerator : EditorWindow
|
|
6
|
+
{
|
|
7
|
+
float m_MatchThreshold = 0.75f;
|
|
8
|
+
|
|
9
|
+
[MenuItem("Tools/Generate RuleTile from Sprites")]
|
|
10
|
+
static void ShowWindow()
|
|
11
|
+
{
|
|
12
|
+
GetWindow<RuleTileGenerator>("RuleTile Generator");
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
void OnGUI()
|
|
16
|
+
{
|
|
17
|
+
GUILayout.Label("Match Threshold", EditorStyles.boldLabel);
|
|
18
|
+
m_MatchThreshold = EditorGUILayout.Slider(m_MatchThreshold, 0.5f, 0.9f);
|
|
19
|
+
|
|
20
|
+
if (GUILayout.Button("Generate from Selected Texture"))
|
|
21
|
+
GenerateRuleTile();
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
void GenerateRuleTile()
|
|
25
|
+
{
|
|
26
|
+
var texture = Selection.activeObject as Texture2D;
|
|
27
|
+
if (texture == null)
|
|
28
|
+
{
|
|
29
|
+
Debug.LogError("Please select a Texture2D asset");
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
// Get sprites from texture
|
|
34
|
+
string path = AssetDatabase.GetAssetPath(texture);
|
|
35
|
+
var sprites = AssetDatabase.LoadAllAssetsAtPath(path).OfType<Sprite>().ToList();
|
|
36
|
+
|
|
37
|
+
if (sprites.Count == 0)
|
|
38
|
+
{
|
|
39
|
+
Debug.LogError("No sprites found in texture. Ensure texture is sliced.");
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
// Complete workflow: sprite-segment-3x3grid -> TilingRules
|
|
44
|
+
var rules = TilemapRuleTileCreateFromSegment.CreateRuleTileFromSprites(
|
|
45
|
+
sprites,
|
|
46
|
+
matchThreshold: m_MatchThreshold
|
|
47
|
+
);
|
|
48
|
+
|
|
49
|
+
// Create and save RuleTile asset
|
|
50
|
+
var ruleTile = ScriptableObject.CreateInstance<RuleTile>();
|
|
51
|
+
TilemapRuleTileCreateFromSegment.ApplyRulesToTile(ruleTile, rules);
|
|
52
|
+
|
|
53
|
+
string savePath = path.Replace(".png", "_RuleTile.asset")
|
|
54
|
+
.Replace(".jpg", "_RuleTile.asset");
|
|
55
|
+
AssetDatabase.CreateAsset(ruleTile, savePath);
|
|
56
|
+
AssetDatabase.SaveAssets();
|
|
57
|
+
|
|
58
|
+
Debug.Log($"Created RuleTile with {rules.Count} rules at {savePath}");
|
|
59
|
+
Selection.activeObject = ruleTile;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
@@ -0,0 +1,225 @@
|
|
|
1
|
+
using System;
|
|
2
|
+
using System.Collections.Generic;
|
|
3
|
+
using System.Linq;
|
|
4
|
+
using UnityEngine;
|
|
5
|
+
|
|
6
|
+
/// <summary>
|
|
7
|
+
/// Creates RuleTile TilingRules by first applying sprite-segment-3x3grid analysis,
|
|
8
|
+
/// then converting the text patterns to neighbor configurations.
|
|
9
|
+
/// </summary>
|
|
10
|
+
public static class TilemapRuleTileCreateFromSegment
|
|
11
|
+
{
|
|
12
|
+
/// <summary>
|
|
13
|
+
/// Grid position to Unity neighbor Vector3Int mapping.
|
|
14
|
+
/// Index 4 (center) is not included as it's not a neighbor.
|
|
15
|
+
/// </summary>
|
|
16
|
+
static readonly Dictionary<int, Vector3Int> k_GridIndexToPosition = new()
|
|
17
|
+
{
|
|
18
|
+
{ 0, new Vector3Int(-1, 1, 0) }, // Top-Left
|
|
19
|
+
{ 1, new Vector3Int(0, 1, 0) }, // Top
|
|
20
|
+
{ 2, new Vector3Int(1, 1, 0) }, // Top-Right
|
|
21
|
+
{ 3, new Vector3Int(-1, 0, 0) }, // Left
|
|
22
|
+
// 4 is center, skipped
|
|
23
|
+
{ 5, new Vector3Int(1, 0, 0) }, // Right
|
|
24
|
+
{ 6, new Vector3Int(-1, -1, 0) }, // Bottom-Left
|
|
25
|
+
{ 7, new Vector3Int(0, -1, 0) }, // Bottom
|
|
26
|
+
{ 8, new Vector3Int(1, -1, 0) }, // Bottom-Right
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
/// <summary>
|
|
30
|
+
/// The 47 known tile patterns from the Common Tile Patterns table.
|
|
31
|
+
/// Patterns not in this set are discarded by default.
|
|
32
|
+
/// </summary>
|
|
33
|
+
static readonly HashSet<string> k_KnownPatterns = new()
|
|
34
|
+
{
|
|
35
|
+
". . . / . * . / . . .", // Fully surrounded
|
|
36
|
+
"X . . / . * . / . . .", // Top left corner missing
|
|
37
|
+
". . X / . * . / . . .", // Top right corner missing
|
|
38
|
+
". . . / . * . / X . .", // Bottom left corner missing
|
|
39
|
+
". . . / . * . / . . X", // Bottom right corner missing
|
|
40
|
+
"X . X / . * . / . . .", // Top corners missing
|
|
41
|
+
". . . / . * . / X . X", // Bottom corners missing
|
|
42
|
+
"X . . / . * . / X . .", // Left corners missing
|
|
43
|
+
". . X / . * . / . . X", // Right corners missing
|
|
44
|
+
"X . . / . * . / . . X", // Top Left and Bottom Right diagonal
|
|
45
|
+
". . X / . * . / X . .", // Top Right and Bottom Left diagonal
|
|
46
|
+
"X . X / . * . / X . .", // Top Left, Top Right, Bottom Left
|
|
47
|
+
"X . X / . * . / . . X", // Top Left, Top Right, Bottom Right
|
|
48
|
+
"X . . / . * . / X . X", // Top Left, Bottom Left, Bottom Right
|
|
49
|
+
". . X / . * . / X . X", // Top Right, Bottom Left, Bottom Right
|
|
50
|
+
"X . X / . * . / X . X", // Cross Section
|
|
51
|
+
"X X X / . * . / . . .", // Flat edge (Bottom)
|
|
52
|
+
". . . / . * . / X X X", // Flat edge (Top)
|
|
53
|
+
". . X / . * X / . . X", // Flat edge (Left)
|
|
54
|
+
"X . . / X * . / X . .", // Flat edge (Right)
|
|
55
|
+
"X X X / . * . / . . X", // L-Shape, Point Right
|
|
56
|
+
". . X / . * X / X . X", // L-Shape, Point Bottom
|
|
57
|
+
"X . . / . * . / X X X", // L-Shape, Point Left
|
|
58
|
+
"X . X / X * . / X . .", // L-Shape, Point Top
|
|
59
|
+
"X X X / . * . / X . .", // L-Shape Inverse, Point Left
|
|
60
|
+
"X . . / X * . / X . X", // L-Shape Inverse, Point Bottom
|
|
61
|
+
". . X / . * . / X X X", // L-Shape Inverse, Point Right
|
|
62
|
+
"X . X / . * X / . . X", // L-Shape Inverse, Point Top
|
|
63
|
+
"X X X / . * . / X . X", // T-Shape, face down
|
|
64
|
+
"X . X / . * . / X X X", // T-Shape, face top
|
|
65
|
+
"X . X / . * X / X . X", // T-Shape, face left
|
|
66
|
+
"X . X / X * . / X . X", // T-Shape, face right
|
|
67
|
+
"X X X / . * . / X X X", // Horizontal bridge
|
|
68
|
+
"X . X / X * X / X . X", // Vertical bridge
|
|
69
|
+
"X X X / X * . / X . .", // Corner piece, Bottom Right
|
|
70
|
+
"X X X / . * X / . . X", // Corner piece, Bottom Left
|
|
71
|
+
". . X / . * X / X X X", // Corner piece, Top Left
|
|
72
|
+
"X . . / X * . / X X X", // Corner piece, Top Right
|
|
73
|
+
"X X X / X * . / X . X", // Edge end, Bottom Right
|
|
74
|
+
"X X X / . * X / X . X", // Edge end, Bottom Left
|
|
75
|
+
"X . X / . * X / X X X", // Edge end, Top Left
|
|
76
|
+
"X . X / X * . / X X X", // Edge end, Top Right
|
|
77
|
+
"X X X / . * X / X X X", // Single isolated tile, Left
|
|
78
|
+
"X X X / X * . / X X X", // Single isolated tile, Right
|
|
79
|
+
"X . X / X * X / X X X", // Single isolated tile, Top
|
|
80
|
+
"X X X / X * X / X . X", // Single isolated tile, Bottom
|
|
81
|
+
"X X X / X * X / X X X", // Center
|
|
82
|
+
};
|
|
83
|
+
|
|
84
|
+
/// <summary>
|
|
85
|
+
/// Creates a RuleTile from sprites by first running sprite-segment-3x3grid analysis.
|
|
86
|
+
/// This is the main entry point that implements the complete workflow.
|
|
87
|
+
/// Duplicate patterns are automatically removed (first sprite wins).
|
|
88
|
+
/// Patterns not in the known 47 Common Tile Patterns are discarded by default.
|
|
89
|
+
/// </summary>
|
|
90
|
+
/// <param name="sprites">Sprites to analyze and create rules for</param>
|
|
91
|
+
/// <param name="matchThreshold">Match threshold for sprite-segment-3x3grid (0.5, 0.75, or 0.9)</param>
|
|
92
|
+
/// <param name="colorTolerance">Color tolerance for sprite-segment-3x3grid</param>
|
|
93
|
+
/// <param name="filterToKnownPatterns">If true (default), discard patterns not in Common Tile Patterns</param>
|
|
94
|
+
/// <returns>Sorted list of unique TilingRules (most specific first)</returns>
|
|
95
|
+
public static List<RuleTile.TilingRule> CreateRuleTileFromSprites(
|
|
96
|
+
IEnumerable<Sprite> sprites,
|
|
97
|
+
float matchThreshold = 0.75f,
|
|
98
|
+
float colorTolerance = 0.04f,
|
|
99
|
+
bool filterToKnownPatterns = true)
|
|
100
|
+
{
|
|
101
|
+
var rules = new List<(RuleTile.TilingRule rule, int specificity, string pattern)>();
|
|
102
|
+
var seenPatterns = new HashSet<string>();
|
|
103
|
+
|
|
104
|
+
foreach (var sprite in sprites)
|
|
105
|
+
{
|
|
106
|
+
// Step 1: Always run sprite-segment-3x3grid first
|
|
107
|
+
string pattern = SpriteSegment3x3Grid.AnalyzeSpriteGrid(sprite, matchThreshold, colorTolerance);
|
|
108
|
+
|
|
109
|
+
// Step 2: Discard patterns not in the known set
|
|
110
|
+
if (filterToKnownPatterns && !k_KnownPatterns.Contains(pattern))
|
|
111
|
+
{
|
|
112
|
+
Debug.Log($"Sprite '{sprite.name}' skipped (unknown pattern: {pattern})");
|
|
113
|
+
continue;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
// Step 3: Skip duplicate patterns (keep first sprite only)
|
|
117
|
+
if (seenPatterns.Contains(pattern))
|
|
118
|
+
continue;
|
|
119
|
+
|
|
120
|
+
seenPatterns.Add(pattern);
|
|
121
|
+
|
|
122
|
+
// Step 4: Create TilingRule from the pattern
|
|
123
|
+
var (rule, specificity) = CreateTilingRuleFromPattern(pattern, sprite);
|
|
124
|
+
rules.Add((rule, specificity, pattern));
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
// Sort by specificity (descending) - more 'This' rules first
|
|
128
|
+
rules.Sort((a, b) => b.specificity.CompareTo(a.specificity));
|
|
129
|
+
|
|
130
|
+
return rules.Select(r => r.rule).ToList();
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
/// <summary>
|
|
134
|
+
/// Returns true if the pattern is one of the 47 known Common Tile Patterns.
|
|
135
|
+
/// </summary>
|
|
136
|
+
public static bool IsKnownPattern(string pattern) => k_KnownPatterns.Contains(pattern);
|
|
137
|
+
|
|
138
|
+
/// <summary>
|
|
139
|
+
/// Creates a single TilingRule from a sprite-segment-3x3grid output pattern.
|
|
140
|
+
/// </summary>
|
|
141
|
+
/// <param name="pattern">Pattern string from sprite-segment-3x3grid, e.g., "X X X / X * X / . . ."</param>
|
|
142
|
+
/// <param name="sprite">Sprite to assign to this rule</param>
|
|
143
|
+
/// <returns>Tuple of (TilingRule, specificity count)</returns>
|
|
144
|
+
public static (RuleTile.TilingRule rule, int specificity) CreateTilingRuleFromPattern(string pattern, Sprite sprite)
|
|
145
|
+
{
|
|
146
|
+
var cells = ParsePattern(pattern);
|
|
147
|
+
var neighbors = new List<int>();
|
|
148
|
+
var neighborPositions = new List<Vector3Int>();
|
|
149
|
+
int specificity = 0;
|
|
150
|
+
|
|
151
|
+
for (int i = 0; i < 9; i++)
|
|
152
|
+
{
|
|
153
|
+
// Skip center cell
|
|
154
|
+
if (i == 4)
|
|
155
|
+
continue;
|
|
156
|
+
|
|
157
|
+
string cell = cells[i];
|
|
158
|
+
|
|
159
|
+
// Map '.' to 'This' rule
|
|
160
|
+
// Map 'X' to DontCare (don't add position)
|
|
161
|
+
if (cell == ".")
|
|
162
|
+
{
|
|
163
|
+
neighbors.Add(RuleTile.TilingRuleOutput.Neighbor.This);
|
|
164
|
+
neighborPositions.Add(k_GridIndexToPosition[i]);
|
|
165
|
+
specificity++;
|
|
166
|
+
}
|
|
167
|
+
// 'X' is implicitly DontCare - position not added
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
var rule = new RuleTile.TilingRule
|
|
171
|
+
{
|
|
172
|
+
m_Neighbors = neighbors,
|
|
173
|
+
m_NeighborPositions = neighborPositions,
|
|
174
|
+
m_Sprites = new[] { sprite },
|
|
175
|
+
m_Output = RuleTile.TilingRuleOutput.OutputSprite.Single,
|
|
176
|
+
m_ColliderType = Tile.ColliderType.Sprite,
|
|
177
|
+
m_RuleTransform = RuleTile.TilingRuleOutput.Transform.Fixed,
|
|
178
|
+
};
|
|
179
|
+
|
|
180
|
+
return (rule, specificity);
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
/// <summary>
|
|
184
|
+
/// Parses a sprite-segment-3x3grid output pattern into an array of 9 cell values.
|
|
185
|
+
/// </summary>
|
|
186
|
+
/// <param name="pattern">Pattern string, e.g., "X X X / X * X / . . ."</param>
|
|
187
|
+
/// <returns>Array of 9 cell strings in order: top-left to bottom-right</returns>
|
|
188
|
+
public static string[] ParsePattern(string pattern)
|
|
189
|
+
{
|
|
190
|
+
var rows = pattern.Split(new[] { " / " }, StringSplitOptions.None);
|
|
191
|
+
if (rows.Length != 3)
|
|
192
|
+
throw new ArgumentException($"Pattern must have 3 rows, got {rows.Length}: {pattern}");
|
|
193
|
+
|
|
194
|
+
var cells = new string[9];
|
|
195
|
+
for (int row = 0; row < 3; row++)
|
|
196
|
+
{
|
|
197
|
+
var rowCells = rows[row].Split(' ');
|
|
198
|
+
if (rowCells.Length != 3)
|
|
199
|
+
throw new ArgumentException($"Row {row} must have 3 cells, got {rowCells.Length}: {rows[row]}");
|
|
200
|
+
|
|
201
|
+
for (int col = 0; col < 3; col++)
|
|
202
|
+
{
|
|
203
|
+
cells[row * 3 + col] = rowCells[col];
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
return cells;
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
/// <summary>
|
|
211
|
+
/// Applies generated rules to a RuleTile asset.
|
|
212
|
+
/// Sets the default sprite to the last rule's sprite (least specific / bottom-most match).
|
|
213
|
+
/// </summary>
|
|
214
|
+
/// <param name="ruleTile">Target RuleTile to configure</param>
|
|
215
|
+
/// <param name="rules">Sorted list of TilingRules to apply</param>
|
|
216
|
+
public static void ApplyRulesToTile(RuleTile ruleTile, List<RuleTile.TilingRule> rules)
|
|
217
|
+
{
|
|
218
|
+
ruleTile.m_TilingRules.Clear();
|
|
219
|
+
ruleTile.m_TilingRules.AddRange(rules);
|
|
220
|
+
|
|
221
|
+
// Use the bottom-most (least specific) rule's sprite as the default
|
|
222
|
+
if (rules.Count > 0 && rules[rules.Count - 1].m_Sprites.Length > 0)
|
|
223
|
+
ruleTile.m_DefaultSprite = rules[rules.Count - 1].m_Sprites[0];
|
|
224
|
+
}
|
|
225
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# Security notes: fix-3d-physics-collisions
|
|
2
|
+
|
|
3
|
+
This skill can have the agent copy `scripts/CollisionDebugger.cs` into the user's project and call it with `unity command script eval` in the user's live Unity Editor, to record which contacts the physics engine reports. Automated skill scanners flag running code in the Editor as a powerful capability. It is intentional, and it is limited by the safeguards below.
|
|
4
|
+
|
|
5
|
+
## Accepted risks
|
|
6
|
+
|
|
7
|
+
| Risk | Capability | Why it is accepted |
|
|
8
|
+
|---|---|---|
|
|
9
|
+
| `SEC_POWER_CAP` | Adds an Editor script to the user's project and runs C# in the user's live Editor | It only reaches the Editor the user already has open, on their own machine, as that user, so it grants nothing they couldn't do themselves. The script ships with this skill and is readable before use. It only reads physics settings and contact data, and logs them to the Console. |
|
|
10
|
+
|
|
11
|
+
## Mitigations
|
|
12
|
+
|
|
13
|
+
- **Only the user's own Editor.** The code runs in the Editor open on this machine. It can't reach another machine or another user's Editor.
|
|
14
|
+
- **Nothing saved to the scene.** The script adds no components. It sets `Collider.providesContacts` on the tracked colliders only during Play mode, which Unity discards when Play mode ends.
|
|
15
|
+
- **Read-only project settings.** It reads `ProjectSettings/DynamicsManager.asset` and never writes to it.
|
|
16
|
+
- **Temporary.** The skill tells the agent to delete the script and its `.meta` file after the diagnosis.
|
|
17
|
+
- **No remote code.** Nothing downloaded from outside is executed.
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: fix-3d-physics-collisions
|
|
3
|
+
description: Diagnoses and fixes 3D PhysX collision, trigger, and raycast problems. Use when asked to fix OnCollisionEnter or OnTriggerEnter not firing, objects passing through each other, raycasts that miss, or a misbehaving MeshCollider.
|
|
4
|
+
required_editor_version: ">=6000.3"
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Diagnose and fix 3D physics collisions
|
|
8
|
+
|
|
9
|
+
## Important
|
|
10
|
+
|
|
11
|
+
- Use the unity cli (`unity command --format json`) and the `unity-cli` and `unity-pipeline` skills for each step.
|
|
12
|
+
- Don't use `using` directives or unqualified types in the `snippet` for `eval`, because the compiler only reads `using UnityEngine`, and a bare `AssetDatabase` or `Object` causes errors (CS0246 / CS0103 / CS0104). `return` what you want to read; it arrives at `data.result.result`.
|
|
13
|
+
- Create a restore point you can roll back to if your changes fail.
|
|
14
|
+
- Do only what's asked. Don't change unrelated assets or files.
|
|
15
|
+
- Avoid long explanations.
|
|
16
|
+
- Never leave verification code in the user's script. Never build logging or detection they didn't ask for, because it clutters their project and console. Read state through `eval` instead, as described in [Final step](#final-step).
|
|
17
|
+
|
|
18
|
+
## Full topic map
|
|
19
|
+
|
|
20
|
+
Read [topic-map.md](references/topic-map.md) before any diagnosis that a Fast-Path doesn't already answer, because this skill's rules must match the installed Unity version. It covers whether the Editor ships local docs or you need docs.unity.com, how to version those URLs, which manual pages cover each condition, and the API lookup route.
|
|
21
|
+
|
|
22
|
+
## Procedure
|
|
23
|
+
|
|
24
|
+
1. Before you call any tool, match the prompt against the [STOP CHECK](#stop-check----match-before-any-tool-call) Fast-Paths. If one matches, write that answer and go to step 5.
|
|
25
|
+
2. Otherwise, get the Unity version from `ProjectSettings/ProjectVersion.txt`, and check which physics components the objects use (Rigidbody, Collider, `CharacterController`). If there's no project or no version, assume Unity 6000.3 and 3D PhysX, say so in your answer, and carry on. If the user gives no symptom, script, or scene to work on, ask for it.
|
|
26
|
+
3. Read the [documentation pages](#full-topic-map) for the symptom.
|
|
27
|
+
4. Find the symptom in [Identify your symptom](#identify-your-symptom), read the reference it points to, and work through it within the [Tool budget](#tool-budget).
|
|
28
|
+
5. If you changed the project, run the [Final step](#final-step) checks. The Tool budget limits diagnosis, not these checks.
|
|
29
|
+
6. End with the answer described in [Required output](#required-output----non-negotiable). If you changed the project, use the [Final report](#final-report) format.
|
|
30
|
+
|
|
31
|
+
## CRITICAL FACT (read first, do not override)
|
|
32
|
+
|
|
33
|
+
Read [kinematic-trigger-facts.md](references/kinematic-trigger-facts.md) before answering anything about two kinematic triggers or Contact Pairs Mode. It holds the required response and the five things not to do, and it overrides prior knowledge.
|
|
34
|
+
|
|
35
|
+
## Required output -- non-negotiable
|
|
36
|
+
|
|
37
|
+
Every invocation MUST end with a user-facing answer that gives the diagnosis and fix, because tool calls alone don't help the user.
|
|
38
|
+
|
|
39
|
+
**Hard stop**: After 5 tool calls of any kind, stop calling tools and write the most-likely diagnosis from the Fast-Paths or checklists, even if not fully confirmed.
|
|
40
|
+
|
|
41
|
+
**No permission-asking**: Never end with "Would you like me to proceed?" or similar. If the script is in the project or an Editor is connected, apply the fix directly by editing the script, or the scene through the Editor. Otherwise, give a complete self-contained explanation. Don't ask, because asking permission costs the user another turn.
|
|
42
|
+
|
|
43
|
+
## STOP CHECK -- match before any tool call
|
|
44
|
+
|
|
45
|
+
Before calling any tool, scan the user's prompt against the Fast-Paths below. The **first** match is the **complete response** -- write the answer and stop. Don't search the project, read files, inspect the scene, run C# in the Editor, or fetch documentation, because these answers are already verified.
|
|
46
|
+
|
|
47
|
+
### Fast-Path 1 -- 2D physics or DOTS
|
|
48
|
+
|
|
49
|
+
- **2D physics** (`Rigidbody2D`, `Collider2D`, `OnCollisionEnter2D`, `Physics2D`): if the `create-2d-physics` skill is installed, use it instead, because it covers both 2D physics systems. Otherwise say this skill covers 3D physics only, and stop.
|
|
50
|
+
- **DOTS** (`PhysicsCollider`, `ICollisionEventsJob`, `ITriggerEventsJob`, `Unity.Physics`, Havok, ECS, Entities): if a `physics-dots` skill is installed, use it instead. Otherwise start with a one-sentence disclaimer that DOTS physics is outside this skill's scope, give a brief best-effort answer with the DOTS APIs (`PhysicsBody`, `PhysicsCollider`, `ICollisionEventsJob`, `SimulationSingleton`), and end with one documentation link.
|
|
51
|
+
|
|
52
|
+
Don't apply 3D PhysX or MonoBehaviour rules to these questions, and don't suggest switching physics systems.
|
|
53
|
+
|
|
54
|
+
### Fast-Path 2 -- Two kinematic triggers not firing OnTriggerEnter
|
|
55
|
+
|
|
56
|
+
**If** both objects are kinematic AND both are triggers: apply the **CRITICAL FACT** response, starting with the layer checks.
|
|
57
|
+
|
|
58
|
+
### Fast-Path 3 -- Ragdoll explodes on frame 1 with no applied forces
|
|
59
|
+
|
|
60
|
+
**If** a ragdoll, jointed body, or character launches or explodes on the first frame with no applied forces:
|
|
61
|
+
- Cause: overlapping colliders cause a one-frame depenetration velocity spike.
|
|
62
|
+
- Fix: shrink the ragdoll colliders so none overlap at the starting pose. State it as the only primary fix.
|
|
63
|
+
- Confirm with **Window > Analysis > Physics Debugger**, which the user opens. It highlights overlapping pairs on the first frame.
|
|
64
|
+
- Do NOT list joint limits, joint projection, joint configuration, joint types, mass ratios, or drive parameters as causes, even when the prompt mentions them, because they don't cause this symptom.
|
|
65
|
+
- Do NOT recommend disabling `Enable Collision` on the joint as the primary fix, because it hides the overlap rather than removing it.
|
|
66
|
+
|
|
67
|
+
### Fast-Path 4 -- CharacterController + OnCollisionEnter not firing
|
|
68
|
+
|
|
69
|
+
**If** the moving object has a `CharacterController` and the user expects `OnCollisionEnter`:
|
|
70
|
+
- `OnCollisionEnter` never fires for movement by `CharacterController.Move()`. Use `OnControllerColliderHit(ControllerColliderHit hit)` instead.
|
|
71
|
+
- Do NOT suggest adding a `Rigidbody`, because a `CharacterController` and a `Rigidbody` on the same object fight over its movement.
|
|
72
|
+
|
|
73
|
+
### Fast-Path 5 -- AddForce stopped working after object settled
|
|
74
|
+
|
|
75
|
+
**If** `AddForce` or `AddTorque` stopped working after the object landed or stopped:
|
|
76
|
+
- Cause: the Rigidbody fell asleep.
|
|
77
|
+
- Fix: call `Rigidbody.WakeUp()` before `AddForce`. Apply the code edit directly, and don't change the Input System or other unrelated code.
|
|
78
|
+
|
|
79
|
+
### Fast-Path 6 -- All physics frozen but raycasts still work
|
|
80
|
+
|
|
81
|
+
**If** callbacks have stopped and forces and gravity have no effect, but `Physics.Raycast` still hits: `Time.timeScale` is `0`. Restore it to `1f`, typically in the pause menu or cutscene controller.
|
|
82
|
+
|
|
83
|
+
### Fast-Path 7 -- Raycast origin inside the target collider
|
|
84
|
+
|
|
85
|
+
**If** `Physics.Raycast` returns false and the ray starts inside the target: read the notes on the [Physics.Raycast](https://docs.unity.com/en-us/engine/<VERSION>/script-reference/unityengine/physics/raycast.md) page, then move the origin outside the collider. Don't suggest **Queries Hit Backfaces**, because it doesn't fix this case.
|
|
86
|
+
|
|
87
|
+
### Fast-Path 8 -- Raycast misses inactive GameObject or disabled Collider
|
|
88
|
+
|
|
89
|
+
**If** the target GameObject is inactive or its Collider is disabled: raycasts ignore it. Make sure `gameObject.activeInHierarchy` and `Collider.enabled` are both true before raycasting.
|
|
90
|
+
|
|
91
|
+
### Fast-Path 9 -- Raycast misses a trigger
|
|
92
|
+
|
|
93
|
+
**If** `Physics.Raycast` doesn't detect a trigger collider: pass `QueryTriggerInteraction.Collide` in that call, because it overrides **Queries Hit Triggers**. See [QueryTriggerInteraction](https://docs.unity.com/en-us/engine/<VERSION>/script-reference/unityengine/querytriggerinteraction.md) and the [Physics settings](https://docs.unity.com/en-us/engine/<VERSION>/manual/unity-editor/editor-settings-reference/comp-manager-group/class-physics-manager.md).
|
|
94
|
+
|
|
95
|
+
### Fast-Path 10 -- IgnoreLayerCollision suppression persisting across scenes
|
|
96
|
+
|
|
97
|
+
**If** `Physics.IgnoreLayerCollision` suppresses collisions unexpectedly or across scenes: recommend the **Layer Collision Matrix** (**Edit > Project Settings > Physics**) first, because it's explicit and doesn't depend on runtime calls. As a code-only fallback, call `Physics.IgnoreLayerCollision(layerA, layerB, false)` at scene load.
|
|
98
|
+
|
|
99
|
+
## Tool budget
|
|
100
|
+
|
|
101
|
+
For cases not covered by the Fast-Paths: **at most 5 tool calls before committing to an answer**. Don't run C# in the Editor or fetch documentation to re-check rules this skill states, because they're already verified.
|
|
102
|
+
|
|
103
|
+
## Identify your symptom
|
|
104
|
+
|
|
105
|
+
Read the reference file that matches the user's symptom:
|
|
106
|
+
|
|
107
|
+
- [Collision checklist](references/collision-checklist.md) - read when `OnCollisionEnter`, `Stay`, or `Exit` doesn't fire or objects pass through each other. Step 10 covers collisions that fail only at speed.
|
|
108
|
+
- [Trigger checklist](references/trigger-checklist.md) - read when `OnTriggerEnter`, `Stay`, or `Exit` doesn't fire. It checks Is Trigger, the Rigidbody rule, layers, the callback signature and location, and non-convex mesh triggers.
|
|
109
|
+
- [Raycast checklist](references/raycast-checklist.md) - read when `Physics.Raycast` misses an object. It checks the LayerMask, non-convex mesh colliders, back faces, and UI targets.
|
|
110
|
+
- [Other symptoms](references/other-symptoms.md) - read when physics works in the Editor but not in a build, a moved collider isn't seen until the next step, there's a visible gap before contact, or a body stops responding.
|
|
111
|
+
- [Collision debugger](references/collision-debugger.md) - read when the user asks to see which contacts physics reports, or the checklists don't confirm a cause. It records contacts in the Editor without adding anything to the scene, and you delete it afterwards.
|
|
112
|
+
|
|
113
|
+
## Console errors
|
|
114
|
+
|
|
115
|
+
Read [console-errors-table.md](references/console-errors-table.md) when the Console shows a physics error, such as a concave MeshCollider message or a contact offset error. Each row maps the error text to its root cause and fix, and Unity creates no physics shape for the collider until you fix it.
|
|
116
|
+
|
|
117
|
+
## Final step
|
|
118
|
+
|
|
119
|
+
Run these checks in order. If any check fails, reread the [docs pages](#full-topic-map) to find out what you missed, fix it, and run the checks again.
|
|
120
|
+
|
|
121
|
+
1. Use `console_status` to check the project has zero console errors.
|
|
122
|
+
2. If the user didn't ask for proof and you don't suspect a fault, stop here.
|
|
123
|
+
3. Otherwise, enter Play mode once and reproduce the case. Read the outcome the user asked for through `eval`, such as whether the bullet's Rigidbody position stopped at the wall, not just the field you changed. Don't add logging or take screenshots, because they cost time and leave changes behind.
|
|
124
|
+
4. Exit Play mode and check again that the console has zero errors.
|
|
125
|
+
|
|
126
|
+
## Final report
|
|
127
|
+
|
|
128
|
+
Give the user a short checklist of what you did and why. List any side effects, such as a project setting you changed or a temporary script you added and removed. If the user needs to follow up with more steps or decisions, list them. For example:
|
|
129
|
+
|
|
130
|
+
```
|
|
131
|
+
I made the following changes:
|
|
132
|
+
|
|
133
|
+
[✓] Set the bullet Rigidbody's Collision Detection to Continuous Speculative, because it moved far enough in one physics step to pass through the wall.
|
|
134
|
+
|
|
135
|
+
Follow these steps to see the effect:
|
|
136
|
+
|
|
137
|
+
1. Enter Play mode and fire at the wall.
|
|
138
|
+
2. Check the bullet stops at the wall instead of passing through it.
|
|
139
|
+
```
|