@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,99 @@
|
|
|
1
|
+
# LevelPlay Common Issues and Solutions
|
|
2
|
+
|
|
3
|
+
Detailed troubleshooting for issues that can occur during integration, referenced from the Common Issues
|
|
4
|
+
table in SKILL.md. Read this when the user reports a compile error, a build failure, ads not loading,
|
|
5
|
+
callbacks not firing, or a platform-specific build error.
|
|
6
|
+
|
|
7
|
+
**Note**: This section addresses issues that can occur during integration. If you haven't started the
|
|
8
|
+
integration yet, begin with Step 1: Verify Environment.
|
|
9
|
+
|
|
10
|
+
## Contents
|
|
11
|
+
- [CS0246 — namespace 'Unity.Services.LevelPlay' not found](#cs0246--namespace-unityserviceslevelplay-not-found)
|
|
12
|
+
- [Android gradle build fails / iOS build fails with dependency errors](#android-gradle-build-fails--ios-build-fails-with-dependency-errors)
|
|
13
|
+
- [Ads not loading](#ads-not-loading)
|
|
14
|
+
- [Callbacks not firing](#callbacks-not-firing)
|
|
15
|
+
- [Platform-specific build errors](#platform-specific-build-errors)
|
|
16
|
+
|
|
17
|
+
## CS0246 — namespace 'Unity.Services.LevelPlay' not found
|
|
18
|
+
|
|
19
|
+
**Root cause**: Ads Mediation package not installed in Unity project
|
|
20
|
+
|
|
21
|
+
**Symptoms:**
|
|
22
|
+
- Compiler errors: `The type or namespace name 'LevelPlay' could not be found`
|
|
23
|
+
- Compiler errors: `The type or namespace name 'Unity.Services.LevelPlay' could not be found`
|
|
24
|
+
- Red underlines in Unity Editor on all LevelPlay code
|
|
25
|
+
|
|
26
|
+
**Solutions:**
|
|
27
|
+
1. Stop providing code immediately
|
|
28
|
+
2. Read `Packages/packages-lock.json` and look for `com.unity.services.levelplay` (the package id behind the **Ads Mediation** display name). Answer this from the project, not by asking the user to read the Package Manager window: it is the same question, and reading it is both faster and reliable.
|
|
29
|
+
3. If the id is absent, the package is not installed. Direct to Step 3 to install via Unity Package Manager
|
|
30
|
+
4. Have them restart Unity Editor after installation (important!)
|
|
31
|
+
5. Verify installation by checking that `using Unity.Services.LevelPlay;` no longer shows errors
|
|
32
|
+
6. Only resume code generation after confirmation and verification
|
|
33
|
+
|
|
34
|
+
**Prevention**: Always verify package installation at Step 7 checkpoint before generating any code.
|
|
35
|
+
|
|
36
|
+
## Android gradle build fails / iOS build fails with dependency errors
|
|
37
|
+
|
|
38
|
+
**Root cause**: Native dependencies not resolved
|
|
39
|
+
|
|
40
|
+
**Symptoms:**
|
|
41
|
+
- **Android**: Gradle build errors mentioning missing dependencies or classes
|
|
42
|
+
- **iOS**: CocoaPods errors, missing frameworks, or linker errors
|
|
43
|
+
- Code compiles perfectly in Unity Editor but fails during platform build
|
|
44
|
+
- Build succeeds in Editor but crashes immediately on device
|
|
45
|
+
|
|
46
|
+
**Solutions:**
|
|
47
|
+
1. Verify you have a dependency manager installed (Mobile Dependency Resolver, Unity External Dependency Manager, or EDM4U)
|
|
48
|
+
2. Check your project's Assets folder for dependency manager tools
|
|
49
|
+
3. Run dependency resolution:
|
|
50
|
+
- **Android (newer MDR versions)**: Should auto-resolve on build. If failing, manually resolve via Assets > Mobile Dependency Resolver > Android Resolver > Resolve
|
|
51
|
+
- **Android (older/other managers)**: Assets > [Your Dependency Manager] > Android Resolver > Resolve
|
|
52
|
+
- **iOS (all managers)**: Assets > [Your Dependency Manager] > iOS Resolver > Install Cocoapods
|
|
53
|
+
4. Verify resolution:
|
|
54
|
+
- **Android**: Check `Assets/Plugins/Android/` for gradle files
|
|
55
|
+
- **iOS**: Look for Podfile or CocoaPods confirmation in console
|
|
56
|
+
5. If you don't have a dependency manager, restart Unity - you should see a prompt to install Mobile Dependency Resolver
|
|
57
|
+
6. Rebuild for your target platform after resolution
|
|
58
|
+
|
|
59
|
+
**Prevention**: Complete Step 4 (dependency resolution) before building for Android/iOS.
|
|
60
|
+
|
|
61
|
+
## Ads not loading
|
|
62
|
+
|
|
63
|
+
**Possible causes:**
|
|
64
|
+
- SDK not initialized before loading ads
|
|
65
|
+
- Incorrect App Key
|
|
66
|
+
- Ad object created before initialization completes
|
|
67
|
+
- Network connectivity issues
|
|
68
|
+
- Ad inventory not available in test region
|
|
69
|
+
|
|
70
|
+
**Solutions:**
|
|
71
|
+
- Verify `LevelPlay.Init()` is called and `OnInitSuccess` fires before creating ad objects
|
|
72
|
+
- Create ad objects only after `OnInitSuccess` callback
|
|
73
|
+
- Check App Key matches LevelPlay dashboard
|
|
74
|
+
- Test on real devices with active internet connection
|
|
75
|
+
- Enable test mode in LevelPlay dashboard for guaranteed test ads (Note: dashboard test mode is separate from mock ads in the Unity Editor — it enables real test ads on device)
|
|
76
|
+
|
|
77
|
+
## Callbacks not firing
|
|
78
|
+
|
|
79
|
+
**Possible causes:**
|
|
80
|
+
- Events registered after SDK initialization
|
|
81
|
+
- Missing event subscriptions
|
|
82
|
+
- Script destroyed before callbacks execute
|
|
83
|
+
|
|
84
|
+
**Solutions:**
|
|
85
|
+
- Register callbacks before calling `Init()`
|
|
86
|
+
- Verify all callbacks are subscribed (check with Debug.Log statements)
|
|
87
|
+
- Use persistent GameObject with DontDestroyOnLoad if needed
|
|
88
|
+
|
|
89
|
+
## Platform-specific build errors
|
|
90
|
+
|
|
91
|
+
**iOS:**
|
|
92
|
+
- Ensure SKAdNetwork IDs are configured in Info.plist
|
|
93
|
+
- Verify ATT is implemented correctly (see `references/ios-setup.md`)
|
|
94
|
+
- Check Xcode build settings for required frameworks
|
|
95
|
+
|
|
96
|
+
**Android:**
|
|
97
|
+
- Verify Google Play Services is included
|
|
98
|
+
- Check AndroidManifest.xml for required permissions
|
|
99
|
+
- Ensure Gradle dependencies are resolved
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: localize-unity-project
|
|
3
|
+
description: Sets up Unity Localization, including locales, String and Asset Tables, and CJK fonts. Use when the user wants to add languages or translate UI text.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
## Important
|
|
7
|
+
|
|
8
|
+
- Use the unity cli (`unity command --format json`) and the `unity-cli` and `unity-pipeline` skills for each step.
|
|
9
|
+
- Before making changes, establish a baseline of the current behavior so you can tell whether a later result is actually caused by your change.
|
|
10
|
+
- Create a restore point you can roll back to if your changes fail.
|
|
11
|
+
- Do only what's asked. Don't change unrelated assets or files. Avoid long explanations.
|
|
12
|
+
- Never leave verification code in the user's script. Never build logging or detection they didn't ask for.
|
|
13
|
+
|
|
14
|
+
## Terms
|
|
15
|
+
|
|
16
|
+
These names differ between the Editor UI, the package API and this skill:
|
|
17
|
+
|
|
18
|
+
- **Table collection**: the asset (`StringTableCollection` or `AssetTableCollection`) holding one **table** per locale plus the shared key list, `SharedData`.
|
|
19
|
+
- **`LocalizedTmpFont`**: the package type that references a `TMP_FontAsset` entry in an Asset Table.
|
|
20
|
+
- **`LocalizedFontAsset`**: this skill's component template ([scripts/LocalizedFontAsset.cs](scripts/LocalizedFontAsset.cs)), not a package type. It applies a `LocalizedTmpFont` to the `TMP_Text` on its GameObject.
|
|
21
|
+
|
|
22
|
+
## 1. Check the Localization package is installed
|
|
23
|
+
Before doing anything else, verify that the Localization package is installed. Many APIs in this skill
|
|
24
|
+
will fail silently or throw confusing errors if the package isn't present.
|
|
25
|
+
|
|
26
|
+
1. **Check by reading the project, not by asking the Package Manager.** Look for
|
|
27
|
+
`com.unity.localization` in **`Packages/packages-lock.json`**, because it records what Unity
|
|
28
|
+
actually resolved and reading it needs no Editor or async call. `Packages/manifest.json` only
|
|
29
|
+
records what was *requested*.
|
|
30
|
+
2. **Install if missing:** `UnityEditor.PackageManager.Client.Add("com.unity.localization")`.
|
|
31
|
+
3. **Wait properly.** `Client.Add` is **asynchronous**, and busy-waiting on `IsCompleted` blocks the
|
|
32
|
+
main thread you are running on. Return after firing the install, then **poll `packages-lock.json`
|
|
33
|
+
in a later call** until the id appears. The install triggers a domain reload, so expect the first
|
|
34
|
+
poll or two to fail.
|
|
35
|
+
4. **Confirm the types are actually loaded** before using them, since the lock file can be written
|
|
36
|
+
before the assemblies are ready:
|
|
37
|
+
```csharp
|
|
38
|
+
var t = System.Type.GetType(
|
|
39
|
+
"UnityEngine.Localization.Settings.LocalizationSettings, Unity.Localization");
|
|
40
|
+
return t != null ? "ready" : "not loaded yet";
|
|
41
|
+
```
|
|
42
|
+
Only proceed once that returns `ready`.
|
|
43
|
+
|
|
44
|
+
## 2. Read the documentation
|
|
45
|
+
|
|
46
|
+
### Full topic map
|
|
47
|
+
|
|
48
|
+
Read [documentation-lookup.md](references/documentation-lookup.md) before any workflow or diagnosis. It covers where the package's local docs live, how to version the doc URLs, and which manual page to open first.
|
|
49
|
+
|
|
50
|
+
### API reference
|
|
51
|
+
|
|
52
|
+
Read [documentation-lookup.md](references/documentation-lookup.md#api-reference) before guessing a package or Engine API signature. It covers the installed package version, `xrefmap.yml` caching, and grepping it for a class or method.
|
|
53
|
+
|
|
54
|
+
## 3. Localization Settings & Locales
|
|
55
|
+
If `LocalizationEditorSettings.ActiveLocalizationSettings` is null, you must find or create it:
|
|
56
|
+
1. **Find:** Use `AssetDatabase.FindAssets("t:LocalizationSettings", new[] { "Assets" })`. If found, load the first one and assign it to `LocalizationEditorSettings.ActiveLocalizationSettings`.
|
|
57
|
+
- **Always pass the search folders.** An unscoped `FindAssets` searches the whole project including
|
|
58
|
+
read-only packages, so it can return an asset from a package and you end up pointing the project
|
|
59
|
+
at something you cannot edit. This applies to every `FindAssets` call in this skill.
|
|
60
|
+
2. **Create:** If not found, create a new instance and save it to `Assets/Localization/LocalizationSettings.asset`. Use `ScriptableObject.CreateInstance<LocalizationSettings>()` followed by `AssetDatabase.CreateAsset()`.
|
|
61
|
+
3. **Activate:** Set `LocalizationEditorSettings.ActiveLocalizationSettings = settings`.
|
|
62
|
+
4. **Locales:** Ensure locales (en, fr, de, etc.) exist. Create them if missing and add them to settings using `LocalizationEditorSettings.AddLocale(locale)`.
|
|
63
|
+
|
|
64
|
+
## 4. Modifying Localization Tables
|
|
65
|
+
Programmatic changes to String or Asset tables require notification to the Editor.
|
|
66
|
+
Always create the required asset tables, unless there is already an existing one in the project.
|
|
67
|
+
|
|
68
|
+
### **Safe Population Pattern**
|
|
69
|
+
When populating tables from a dataset, match by `Locale.Identifier.Code` explicitly. The order of `GetLocales()` is not guaranteed to match your input data array — assuming it does will cause silent data mismatches that are very hard to debug.
|
|
70
|
+
For **Asset Tables**, use the GUID of the asset: `table.GetEntry(sharedId) ?? table.AddEntry(sharedId, guid);`.
|
|
71
|
+
|
|
72
|
+
### **Refresh & Notification**
|
|
73
|
+
After any modification (adding keys, updating values), notify the Editor so it can refresh its internal state. Skipping this will leave the Editor showing stale data until the next reimport.
|
|
74
|
+
1. Call `EditorUtility.SetDirty(collection)`, `EditorUtility.SetDirty(collection.SharedData)`, on each modified `Table`.
|
|
75
|
+
2. **Notify:** `LocalizationEditorSettings.EditorEvents.RaiseCollectionModified(sender, collection);`
|
|
76
|
+
3. Always call `AssetDatabase.SaveAssets()` at the end.
|
|
77
|
+
|
|
78
|
+
## 5. UI Localization and Layout
|
|
79
|
+
### **Namespacing & Conflicts**
|
|
80
|
+
|
|
81
|
+
Read [locale-switching.md](references/locale-switching.md) before adding a language menu or any locale-switching code, so the change goes through the package rather than a hand-rolled current-language variable.
|
|
82
|
+
|
|
83
|
+
### **Localized String Events (Robust Binding)**
|
|
84
|
+
1. **Check Component Type:** Identify if the target is `TextMeshPro` or legacy `UnityEngine.UI.Text`.
|
|
85
|
+
2. **Bind Correctly:** add the public `UnityEngine.Localization.Components.LocalizeStringEvent`
|
|
86
|
+
component and wire it yourself — set `StringReference` to the table entry, then add an
|
|
87
|
+
`OnUpdateString` listener that assigns the value to the text component (`TMP_Text.text` for
|
|
88
|
+
TextMeshPro, `UnityEngine.UI.Text.text` for legacy Text).
|
|
89
|
+
|
|
90
|
+
Do **not** reflect into `UnityEditor.Localization.Plugins.TMPro.LocalizeComponent_TMPro` or its
|
|
91
|
+
UGUI counterpart, because they are `internal` and can change in any package release.
|
|
92
|
+
3. **Layout Rebuild:** After setting localized text or populating a list, call `UnityEngine.UI.LayoutRebuilder.ForceRebuildLayoutImmediate(parentTransform)` to ensure dimensions update.
|
|
93
|
+
|
|
94
|
+
## 6. Asian Language Font Support (CJK)
|
|
95
|
+
Read [references/cjk-fonts.md](references/cjk-fonts.md) before setting up fonts for Chinese, Japanese or Korean locales, and follow it in order.
|
|
96
|
+
|
|
97
|
+
## 7. Automatic Layout (UGUI)
|
|
98
|
+
Translated strings are often much longer than the source text, so a label sized for one language clips or overflows in another.
|
|
99
|
+
|
|
100
|
+
1. Read the UGUI auto layout pages listed in [references/docs-map.md](references/docs-map.md) before changing a layout, because the right layout group and fitter settings depend on the existing hierarchy.
|
|
101
|
+
2. Change only the containers of labels that overflow in at least one locale, because a fixed layout that already fits every locale is the user's design.
|
|
102
|
+
3. Verify by switching to each locale and checking `TMP_Text.isTextOverflowing` on the affected labels.
|
|
103
|
+
|
|
104
|
+
### Notes when translating an existing project
|
|
105
|
+
|
|
106
|
+
Read [translating-existing-project.md](references/translating-existing-project.md) when localizing UI that already exists. It covers minimal-code-change mapping, listener wiring with its read-back checks, and the refresh rules.
|
|
107
|
+
|
|
108
|
+
### Table completeness check (run this before declaring the work done)
|
|
109
|
+
|
|
110
|
+
Read [references/table-completeness-check.md](references/table-completeness-check.md), run the check it contains, and report the output.
|
|
111
|
+
|
|
112
|
+
- **Smart Strings**: Set up smart strings where needed. Inspect the context of each string by taking the entire UI it is on, and any scripts that affect it, into account. Set the context on the string table to ensure translations make sense.
|
|
113
|
+
|
|
114
|
+
## 8. Recommended Translation Strategy
|
|
115
|
+
Read [references/translation-strategy.md](references/translation-strategy.md) when translating an existing project or finding text that still needs localizing.
|
|
116
|
+
|
|
117
|
+
|
|
118
|
+
## 9. Accelerated Localization Workflow
|
|
119
|
+
To localize an entire project efficiently, use a batch processing script that handles all scenes in one pass.
|
|
120
|
+
|
|
121
|
+
**Ask before acting:** Before running any batch operation, confirm with the user:
|
|
122
|
+
> "This will open every scene in the project, attach `LocalizeStringEvent` components, and save all modified scenes. This cannot be undone automatically. Shall I proceed?"
|
|
123
|
+
|
|
124
|
+
Only proceed once the user has confirmed. The batch processor template is in [scripts/L10nBatchProcessor.cs](scripts/L10nBatchProcessor.cs).
|
|
125
|
+
|
|
126
|
+
`LocalizeAll` also enforces this itself, so do not remove or bypass these checks when adapting the template: it refuses to run in batch mode, prompts the user to save or discard unsaved scene changes, and shows a blocking Editor dialog that lists the scenes it will rewrite. Tell the user to watch the Editor and click the confirm button; if they cancel, it throws `OperationCanceledException` and writes nothing. Report that as a cancellation, not an error to work around.
|
|
127
|
+
|
|
128
|
+
It walks **both** `Text` and `TMP_Text`, and `LocalizeAll` **returns the labels it could not match**
|
|
129
|
+
(as `scene :: object :: "text"`). Print that list. It is the whole point of the return value: a run
|
|
130
|
+
that wires 20 labels and silently leaves 9 alone looks identical to a complete one otherwise. The
|
|
131
|
+
list covers authored text only, so pair it with the code scan in [references/translation-strategy.md](references/translation-strategy.md) and the table completeness
|
|
132
|
+
check in Step 7.
|
|
133
|
+
|
|
134
|
+
### **Technical Tips for Speed**
|
|
135
|
+
- **Table References:** Use `TableReference` names (strings) instead of GUIDs — they are easier to read and maintain.
|
|
136
|
+
- **Batch Refresh:** Use `LocalizationSettings.Instance.ForceRefresh()` after modifications to force the UI to update in the editor.
|
|
137
|
+
- **Font Swap Automation:** Create the `GameAssets` table once and use a script to attach the `LocalizedFontAsset` component ([template](scripts/LocalizedFontAsset.cs)) to all labels in one pass.
|
|
138
|
+
|
|
139
|
+
## Troubleshooting errors
|
|
140
|
+
|
|
141
|
+
If an error appears in the console or the game UI, look it up in [references/troubleshooting.md](references/troubleshooting.md), apply the resolution, then reread the [docs pages](#full-topic-map) for the step that produced it.
|
|
142
|
+
|
|
143
|
+
## Final step
|
|
144
|
+
|
|
145
|
+
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.
|
|
146
|
+
|
|
147
|
+
1. Run `unity command console status` (the `console_status` check) and confirm `groundTruth.consoleErrors` is 0 and `compilationFailed` is false.
|
|
148
|
+
2. Run the [table completeness check](references/table-completeness-check.md) and keep its output for the report.
|
|
149
|
+
3. Stop there unless the user asked for proof or a specific fault is suspected, such as a label that doesn't change when the locale changes.
|
|
150
|
+
4. If a fault is suspected and the change affects runtime behaviour, enter Play mode once to chase it. Read the world through `eval`, for example `LocalizationSettings.SelectedLocale` and the `text` of the label in question, rather than adding logging. Take no screenshots, because they take too much time. Exit Play mode when you're done.
|
|
151
|
+
|
|
152
|
+
## Final report
|
|
153
|
+
|
|
154
|
+
Report these in order:
|
|
155
|
+
|
|
156
|
+
1. **What changed**: locales, tables, keys, components and font assets you added or changed.
|
|
157
|
+
2. **Not converted**: every text site you didn't convert, and why, including `LocalizeAll`'s unmatched labels.
|
|
158
|
+
3. **Verification results**: the result of each Final step check, including the table completeness check output and any gaps.
|
|
159
|
+
4. **Follow-up**: what the user must do, such as confirm which gaps are intentional, review translations, or rebuild Addressables content.
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# Localization API pitfalls
|
|
2
|
+
|
|
3
|
+
These are the failures the API pages don't warn about. For the API itself, read the `LocalizationEditorSettings`, Addressables and TMP pages listed in `docs-map.md`, and the `Addressables.md` manual page for how Asset Tables load their assets.
|
|
4
|
+
|
|
5
|
+
## Asset Table entries need a save
|
|
6
|
+
`EditorUtility.SetDirty(table)` only marks the table. Without `AssetDatabase.SaveAssets()` an entry added with `table.GetEntry(sharedEntryId) ?? table.AddEntry(sharedEntryId, guid)` reads back correctly for the rest of the session and is gone when the Editor closes. Follow the save sequence in the parent skill: dirty the collection and its `SharedData` too, then save once at the end.
|
|
7
|
+
|
|
8
|
+
## Avoid the Resources folder
|
|
9
|
+
Don't reference assets inside a `Resources/` folder in Asset Tables, because Addressables can't load sub-assets from `Resources/` and fails with `OperationException: Failed to load sub-asset`. This catches the TMP default font, which lives under `Assets/TextMesh Pro/Resources/`. Copy the asset out with `AssetDatabase.CopyAsset` (for example to `Assets/Fonts/`), and use the copy's path for Addressables and the Asset Table.
|
|
10
|
+
|
|
11
|
+
## TMP_FontAsset repair
|
|
12
|
+
If fonts appear as "tofu" or throw `UnassignedReferenceException`:
|
|
13
|
+
- Check that the Material and Atlas Texture are nested under the Font Asset in the Project window.
|
|
14
|
+
- Re-assign `fontAsset.material.mainTexture = fontAsset.atlasTexture;` and re-save.
|
|
15
|
+
- If the font was deleted and recreated, update the GUID in both the Asset Table and the Addressables Group.
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
# CJK Font Support
|
|
2
|
+
|
|
3
|
+
Avoid TMP Fallback Fonts for CJK locales. Use **Asset Table Font Swapping** for each specific locale instead — fallbacks are unreliable and hard to debug when glyphs are missing.
|
|
4
|
+
|
|
5
|
+
### Prerequisite: TMP Essential Resources must be imported
|
|
6
|
+
|
|
7
|
+
**Check this before touching any TMP API.** In a project that has never imported them,
|
|
8
|
+
`TMP_Settings.instance` is `null` and TMP calls fail with a bare
|
|
9
|
+
`NullReferenceException` that names nothing useful. `TMP_FontAsset.CreateFontAsset` is one of them, so
|
|
10
|
+
font creation dies on the first line with an error that looks like a bug in your code.
|
|
11
|
+
|
|
12
|
+
```csharp
|
|
13
|
+
// The check.
|
|
14
|
+
var ready = TMPro.TMP_Settings.instance != null;
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
If it is not ready, import them **non-interactively**:
|
|
18
|
+
|
|
19
|
+
```csharp
|
|
20
|
+
// Do NOT use EditorApplication.ExecuteMenuItem("Window/TextMeshPro/Import TMP Essential Resources").
|
|
21
|
+
// It returns true and then opens a dialog that waits for a human, so nothing gets imported and the
|
|
22
|
+
// run appears to hang. Import the package directly instead.
|
|
23
|
+
string package = null;
|
|
24
|
+
var cache = System.IO.Path.GetFullPath(System.IO.Path.Combine(
|
|
25
|
+
UnityEngine.Application.dataPath, "..", "Library", "PackageCache"));
|
|
26
|
+
foreach (var dir in System.IO.Directory.GetDirectories(cache))
|
|
27
|
+
{
|
|
28
|
+
// TMP ships inside com.unity.ugui in Unity 6, and the folder name carries a version hash,
|
|
29
|
+
// so search for the file rather than hardcoding a path.
|
|
30
|
+
var candidate = System.IO.Path.Combine(dir, "Package Resources", "TMP Essential Resources.unitypackage");
|
|
31
|
+
if (System.IO.File.Exists(candidate)) { package = candidate; break; }
|
|
32
|
+
}
|
|
33
|
+
UnityEditor.AssetDatabase.ImportPackage(package, false); // false = non-interactive
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
Then poll `TMP_Settings.instance != null` in a **later** call, the same way as the package check in
|
|
37
|
+
Step 1 of the skill, and only continue once it is non-null. Verified on Unity 6000.5.8f1: the non-interactive
|
|
38
|
+
import completes in a few seconds and the assets land in `Assets/TextMesh Pro`.
|
|
39
|
+
|
|
40
|
+
1. **Use locale-specific fonts:** Western fonts like Arial or Liberation Sans don't contain CJK glyphs, which results in "tofu" (square blocks). Always use a font designed for the target language:
|
|
41
|
+
- For **Simplified Chinese (zh-Hans)**: Use `msyh.ttc` (Microsoft YaHei) or equivalent.
|
|
42
|
+
- For **Japanese (ja)**: Use `msgothic.ttc` (MS Gothic) or equivalent.
|
|
43
|
+
- For **Korean (ko)**: Use `malgun.ttf` (Malgun Gothic) or equivalent.
|
|
44
|
+
- If system font copying fails, stop and report it. Do not substitute with a Western font.
|
|
45
|
+
2. **Robust Font Creation:** Create dynamic `TMP_FontAsset` from imported fonts.
|
|
46
|
+
3. **Multi-Atlas & Dynamic:** CJK character sets are too large for static atlases; a single atlas will run out of space immediately.
|
|
47
|
+
- `fontAsset.atlasPopulationMode = AtlasPopulationMode.Dynamic;`
|
|
48
|
+
- `fontAsset.isMultiAtlasTexturesEnabled = true;`
|
|
49
|
+
4. **Sub-Assets:** add the atlas textures **and the material**. Adding only the texture is the usual
|
|
50
|
+
mistake, and the material then never reaches the file at all: measured on Unity 6000.5.8f1, a font
|
|
51
|
+
asset saved without the second call contains **zero** `Material` objects on disk, and one with it.
|
|
52
|
+
A material that exists only in memory is not part of the asset, so anything that loads the asset
|
|
53
|
+
fresh gets whatever TMP reconstructs rather than the material you configured, and any setting you
|
|
54
|
+
applied to it is silently gone.
|
|
55
|
+
```csharp
|
|
56
|
+
// Every atlas texture, not just the first. Step 3 enabled multi-atlas, so there may be several.
|
|
57
|
+
foreach (var atlas in fontAsset.atlasTextures)
|
|
58
|
+
{
|
|
59
|
+
UnityEditor.AssetDatabase.AddObjectToAsset(atlas, fontAsset);
|
|
60
|
+
}
|
|
61
|
+
// The material too. Without this line it is not written into the asset.
|
|
62
|
+
UnityEditor.AssetDatabase.AddObjectToAsset(fontAsset.material, fontAsset);
|
|
63
|
+
```
|
|
64
|
+
- Explicitly link the material's texture: `fontAsset.material.mainTexture = fontAsset.atlasTexture;`
|
|
65
|
+
and set the font asset, its material, and its textures dirty before saving. (`atlasTexture` is
|
|
66
|
+
the first entry of `atlasTextures`, which is what the primary material draws from, so this is
|
|
67
|
+
consistent with adding every texture above.)
|
|
68
|
+
- **Verify against the file, not against the object you are holding.** After
|
|
69
|
+
`AssetDatabase.SaveAssets()`, call `AssetDatabase.LoadAllAssetsAtPath(path)` and confirm a
|
|
70
|
+
`Material` is among the returned objects. Do not settle for `fontAsset.material != null`: that
|
|
71
|
+
stays true whether or not the material was saved, because TMP will hand back an in-memory one,
|
|
72
|
+
so it cannot tell a saved material from an unsaved one.
|
|
73
|
+
5. **Addressables:** Every asset referenced in an Asset Table must be marked as Addressable.
|
|
74
|
+
- Do not reference assets inside a `Resources/` folder in an Asset Table. This causes `OperationException: Failed to load sub-asset` errors. If an asset is in `Resources/`, copy it to `Assets/Fonts/` or similar before making it Addressable.
|
|
75
|
+
- If a font asset is deleted and recreated, the new GUID must be manually updated in the Asset Table and re-added to Addressables.
|
|
76
|
+
6. **Specialized Types:** For TextMesh Pro font swapping, prefer `LocalizedTmpFont` over `LocalizedAsset<TMP_FontAsset>` to avoid implicit conversion errors.
|
|
77
|
+
7. **Build Requirement:** After updating Asset Tables or Addressable groups, trigger a build: `AddressableAssetSettings.BuildPlayerContent();`.
|
|
78
|
+
|
|
79
|
+
### **Verification Step**
|
|
80
|
+
Before concluding any CJK localization task:
|
|
81
|
+
1. **The Tofu Check:** Switch the editor locale to `zh-Hans`, `ja`, and `ko`. Inspect the UI. If any characters appear as squares (tofu), the font setup has FAILED.
|
|
82
|
+
2. **Asset Table Check:** Verify that the `AssetTable` for the CJK locale points to the correct CJK `TMP_FontAsset`, NOT a default Western font.
|
|
83
|
+
3. **Multi-Atlas Check:** Confirm `isMultiAtlasTexturesEnabled` is `true` on the CJK font assets.
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
# Localization docs map
|
|
2
|
+
|
|
3
|
+
## Pages
|
|
4
|
+
|
|
5
|
+
Localization manual, local at `<project-folder>/Library/PackageCache/com.unity.localization@*/Documentation~/` (online fallback: `https://docs.unity3d.com/Packages/com.unity.localization@<VERSION>/manual/`, same names with `.html`):
|
|
6
|
+
- `QuickStartGuideWithVariants.md`: end-to-end setup.
|
|
7
|
+
- `LocaleSelector.md`: startup locale selectors, including the Specific Locale Selector.
|
|
8
|
+
- `StringTables.md` and `AssetTables.md`: table collections and entries.
|
|
9
|
+
- `Addressables.md`: how tables and assets use Addressables groups.
|
|
10
|
+
- `EditModeSupport.md`: the Localization Scene Controls window and Edit mode events.
|
|
11
|
+
- `Smart/SmartStrings.md`: smart strings, plurals and arguments.
|
|
12
|
+
|
|
13
|
+
Localization API, under `https://docs.unity3d.com/Packages/com.unity.localization@<VERSION>/api/`:
|
|
14
|
+
- `UnityEditor.Localization.LocalizationEditorSettings.html`: settings, locales and collections.
|
|
15
|
+
- `UnityEngine.Localization.Settings.LocalizationSettings.html`: `SelectedLocale` and `AvailableLocales`.
|
|
16
|
+
- `UnityEngine.Localization.Components.LocalizeStringEvent.html`: binding a string to a label.
|
|
17
|
+
- `UnityEngine.Localization.LocalizedTmpFont.html`: the localized TMP font reference.
|
|
18
|
+
|
|
19
|
+
TMP API, under `https://docs.unity3d.com/Packages/com.unity.ugui@<VERSION>/api/`:
|
|
20
|
+
- `TMPro.TMP_FontAsset.html`: `atlasPopulationMode`, `isMultiAtlasTexturesEnabled` and `HasCharacters`.
|
|
21
|
+
- `TMPro.TMP_Text.html`: `text` and `isTextOverflowing`.
|
|
22
|
+
|
|
23
|
+
UGUI manual, under `https://docs.unity3d.com/Packages/com.unity.ugui@<VERSION>/manual/`:
|
|
24
|
+
- `UIAutoLayout.html`: how layout groups and layout elements size labels.
|
|
25
|
+
- `script-VerticalLayoutGroup.html` and `script-ContentSizeFitter.html`: the components that let labels grow with longer translations.
|
|
26
|
+
|
|
27
|
+
Addressables API, under `https://docs.unity3d.com/Packages/com.unity.addressables@<VERSION>/api/`:
|
|
28
|
+
- `UnityEditor.AddressableAssets.Settings.AddressableAssetSettings.html`: `CreateOrMoveEntry` and `BuildPlayerContent`.
|
|
29
|
+
|
|
30
|
+
Script Reference, under `https://docs.unity.com/en-us/engine/<VERSION>/script-reference/`:
|
|
31
|
+
- `unityeditor/packagemanager/client/add.md`: adding a package from script.
|
|
32
|
+
- `unityeditor/assetdatabase/addobjecttoasset.md` and `unityeditor/assetdatabase/loadallassetsatpath.md`: saving and reading back sub-assets.
|
|
33
|
+
- `unityeditor/assetdatabase/importpackage.md`: importing a `.unitypackage` without a dialog.
|
|
34
|
+
- `unityeditor/events/unityeventtools/addpersistentlistener.md` and `unityengine/events/unityeventbase/setpersistentlistenerstate.md`: persistent listeners.
|
|
35
|
+
|
|
36
|
+
## Engine API lookup
|
|
37
|
+
|
|
38
|
+
Engine APIs (`UnityEditor.AssetDatabase`, `UnityEditor.PackageManager`, `UnityEngine.Events`) are versioned by Unity version, so check the project's Unity version first. Then:
|
|
39
|
+
|
|
40
|
+
1. If the Editor install folder has a `Data/Documentation` folder (e.g. `.../Unity/Hub/Editor/6000.6.0b2/Editor/Data/Documentation`), grep the html files in the `en/ScriptReference` folder inside, and skip the remaining steps.
|
|
41
|
+
2. Otherwise, fetch and cache `https://docs.unity3d.com/<VERSION>/Documentation/ScriptReference/xrefmap.yml` (replace `<VERSION>` with the Unity version, e.g. `6000.3`) and grep it for the `uid` (about 6 MB, so don't read the whole file).
|
|
42
|
+
3. Convert the `uid` to a markdown page: remove the parameters in brackets, lowercase it, replace `.` with `/`, and add `.md`. Then fetch `https://docs.unity.com/en-us/engine/<VERSION>/script-reference/<converted uid>`. For example, `UnityEditor.AssetDatabase.ImportPackage(System.String,System.Boolean)` => `https://docs.unity.com/en-us/engine/6000.3/script-reference/unityeditor/assetdatabase/importpackage.md`. If the page doesn't exist, use the `href` in the `xrefmap.yml` entry under `https://docs.unity3d.com/<VERSION>/Documentation/ScriptReference/`.
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
# Full topic map
|
|
2
|
+
|
|
3
|
+
Before you go forward with a workflow or diagnosis:
|
|
4
|
+
|
|
5
|
+
1. Open and read the [documentation page(s)](#full-topic-map) that cover the specific subject related to what you intend to do or fix and check if you've missed anything.
|
|
6
|
+
2. Name the file(s) you read in your response.
|
|
7
|
+
|
|
8
|
+
This is because your training knowledge about Unity might be out of date, incorrect, or for the wrong Unity version.
|
|
9
|
+
|
|
10
|
+
The docs pages are local markdown conversions of the Unity Manual, stored at `<project-folder>/Library/PackageCache/com.unity.localization@*/`. When reading docs, read only the .md files in that subfolder and don't browse other Library or PackageCache folders, because that takes too much time. This limit doesn't apply to package lookups that other steps run, such as the TMP import in [references/cjk-fonts.md](cjk-fonts.md). If that folder has no `.md` files, use the online pages at `https://docs.unity3d.com/Packages/com.unity.localization@<VERSION>/manual/` instead, because some package versions don't ship their docs.
|
|
11
|
+
|
|
12
|
+
Prefer `WebFetch` over `WebSearch` — faster and lands on the exact reference. Only fetch what you need. Replace `<VERSION>` with the following before fetching:
|
|
13
|
+
|
|
14
|
+
- **Package on docs.unity3d.com**: The package version, eg `@6.6` or `@2.0`. Check the package version if unsure.
|
|
15
|
+
- **docs.unity.com**: The product version, eg `7000.0`
|
|
16
|
+
|
|
17
|
+
Read the Unity version from `ProjectSettings/ProjectVersion.txt`, and each package's major.minor from `Packages/packages-lock.json` (for example `1.5` for `com.unity.localization`). TextMesh Pro (TMP) API pages are in the `com.unity.ugui` docs. If `packages-lock.json` lists `com.unity.textmeshpro` instead, use `https://docs.unity3d.com/Packages/com.unity.textmeshpro@<VERSION>/api/` with that package's version.
|
|
18
|
+
|
|
19
|
+
Read [references/docs-map.md](docs-map.md) for the manual, API and Script Reference pages to read.
|
|
20
|
+
|
|
21
|
+
# API reference
|
|
22
|
+
|
|
23
|
+
The API is `UnityEngine.Localization` and `UnityEditor.Localization`, part of the `com.unity.localization` package. It is versioned by package version, not Unity version (e.g. `@1.4`, `@1.5`), so check the project's installed package version before relying on a specific class or method.
|
|
24
|
+
|
|
25
|
+
1. Read the installed package version from `Packages/packages-lock.json`, as in [Step 1](../SKILL.md#1-check-the-localization-package-is-installed).
|
|
26
|
+
2. Fetch and cache `https://docs.unity3d.com/Packages/com.unity.localization@<version>/xrefmap.yml` (replace `<version>` with the installed package version, e.g. `1.5`). This file maps every public API member's fully qualified name to its docs page `href` (e.g. `href: api/UnityEngine.Localization.LocalizedTmpFont.html` => `https://docs.unity3d.com/Packages/com.unity.localization@1.5/api/UnityEngine.Localization.LocalizedTmpFont.html`).
|
|
27
|
+
3. Grep the yml file locally for a class or method instead of refetching per lookup. Don't read the whole file.
|
|
28
|
+
|
|
29
|
+
Always fetch the version matching the installed package rather than relying on training knowledge, since APIs are frequently marked obsolete between major versions. The same steps work for the TMP (`com.unity.ugui` or `com.unity.textmeshpro`) and `com.unity.addressables` APIs.
|
|
30
|
+
|
|
31
|
+
For Engine APIs (`UnityEditor.AssetDatabase`, `UnityEditor.PackageManager`, `UnityEngine.Events`), follow the Engine API lookup steps in [references/docs-map.md](docs-map.md).
|
|
32
|
+
|
|
33
|
+
For Asset Table entry, `Resources/` folder and font repair pitfalls, see [references/api-notes.md](api-notes.md).
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# **Namespacing & Conflicts**
|
|
2
|
+
|
|
3
|
+
- **Single Instance:** Always check `GameObject.Find("YourCanvasName")` and destroy the old one before creating a new one.
|
|
4
|
+
- **Locale switching: use the package, and keep preview and runtime separate.** These are two
|
|
5
|
+
different mechanisms, and conflating them is why locale switching often ends up hand-rolled.
|
|
6
|
+
- **To preview a locale while authoring**, use the **Localization Scene Controls** window
|
|
7
|
+
(`Window > Asset Management > Localization Scene Controls`). This is Editor-only. It is not a
|
|
8
|
+
runtime feature, so it is not the answer when the game itself needs a language setting.
|
|
9
|
+
- **To switch locale at runtime**, assign `LocalizationSettings.SelectedLocale`. That is the
|
|
10
|
+
supported entry point, and everything bound through `LocalizeStringEvent` updates from it.
|
|
11
|
+
- **To pin which locale the game starts in**, configure a startup locale selector on the
|
|
12
|
+
Localization Settings asset. `SpecificLocaleSelector` is the one that forces a chosen locale;
|
|
13
|
+
the default chain otherwise picks up the system language.
|
|
14
|
+
- **NEVER hand-roll locale state.** A real in-game language menu is fine and expected, as long as
|
|
15
|
+
it sets `SelectedLocale` and lets the package propagate the change. What is forbidden is a debug
|
|
16
|
+
dropdown or menu that tracks its own "current language" variable, swaps strings itself, or
|
|
17
|
+
reaches around the package, because nothing else in the project will follow it.
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
# Table Completeness Check
|
|
2
|
+
|
|
3
|
+
Enumerating the tables answers "did every key get a value in every locale" mechanically, so a missing
|
|
4
|
+
entry is found before anyone plays the game. Run it and report the output.
|
|
5
|
+
|
|
6
|
+
```csharp
|
|
7
|
+
var gaps = new System.Collections.Generic.List<string>();
|
|
8
|
+
var checkedCount = 0;
|
|
9
|
+
|
|
10
|
+
foreach (var col in UnityEditor.Localization.LocalizationEditorSettings.GetStringTableCollections())
|
|
11
|
+
{
|
|
12
|
+
foreach (var key in col.SharedData.Entries)
|
|
13
|
+
{
|
|
14
|
+
foreach (var table in col.StringTables)
|
|
15
|
+
{
|
|
16
|
+
checkedCount++;
|
|
17
|
+
var entry = table.GetEntry(key.Id);
|
|
18
|
+
// A missing entry and a present-but-empty entry both show as untranslated in game.
|
|
19
|
+
if (entry == null || string.IsNullOrWhiteSpace(entry.Value))
|
|
20
|
+
{
|
|
21
|
+
gaps.Add($"{col.TableCollectionName} / {table.LocaleIdentifier.Code} / {key.Key}");
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
// Zero entries is not a pass. It means no collections or no locales were found, so the check
|
|
28
|
+
// examined nothing: report that distinctly instead of letting it read as success.
|
|
29
|
+
if (checkedCount == 0)
|
|
30
|
+
{
|
|
31
|
+
return "INCONCLUSIVE: no table entries found. Either no String Table Collection exists yet, "
|
|
32
|
+
+ "or the collection has no locale tables. Fix that before trusting this check.";
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
return gaps.Count == 0
|
|
36
|
+
? $"COMPLETE: {checkedCount} entries checked, no gaps"
|
|
37
|
+
: $"GAPS ({gaps.Count} of {checkedCount} checked):\n " + string.Join("\n ", gaps);
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
Verified on Unity 6000.5.8f1 against a table with one deliberately emptied `ja` value: it reports
|
|
41
|
+
`GAPS 1 of 4` naming exactly that entry, `COMPLETE (4 checked)` once the value is filled, and
|
|
42
|
+
`INCONCLUSIVE` in a project with no tables.
|
|
43
|
+
|
|
44
|
+
**Report the gap list rather than resolving it silently.** Some gaps are decisions, not mistakes: a
|
|
45
|
+
locale you were not asked to translate, or a key that is intentionally identical across languages.
|
|
46
|
+
Filling those with the English text hides the decision. List them and let the user say which are
|
|
47
|
+
intentional.
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
# Notes when translating an existing project
|
|
2
|
+
- **Minimal Code Changes**: Never modify code unrelated to localization. Use a static helper class (e.g., `L10n`) to wrap `LocalizationSettings.StringDatabase.GetLocalizedString` for easy injection into existing scripts.
|
|
3
|
+
- **Robust Mapping Strategy**: When mapping existing UI text to keys, sort keys by string length (descending) and match longest strings first. This prevents short strings (like "NO") from matching parts of longer sentences. Use case-insensitive matching where appropriate.
|
|
4
|
+
- **Component Event Listeners**: wire `LocalizeStringEvent.OnUpdateString` with
|
|
5
|
+
`UnityEventTools.AddPersistentListener`, passing a delegate built over the text component's public
|
|
6
|
+
`text` setter. The setter has no C# method-group name, so build the delegate by name:
|
|
7
|
+
`(UnityAction<string>)Delegate.CreateDelegate(typeof(UnityAction<string>), text, "set_text")`.
|
|
8
|
+
That is reflection over a **public** member, which is fine. See
|
|
9
|
+
[scripts/L10nBatchProcessor.cs](../scripts/L10nBatchProcessor.cs) for the working version, including
|
|
10
|
+
clearing any existing persistent listeners first so repeated runs don't stack duplicates.
|
|
11
|
+
- Do **not** write the persistent-call fields directly through `SerializedObject` (`m_MethodName`,
|
|
12
|
+
`m_Mode`, `m_PersistentCalls`). Those are private serialized names with no compatibility
|
|
13
|
+
guarantee, and it isn't necessary: `AddPersistentListener` with the delegate above produces the
|
|
14
|
+
same serialized call (target = the text component, method = `set_text`, mode = `EventDefined`).
|
|
15
|
+
- **You must then set the call state, or the label will not update in the Editor.**
|
|
16
|
+
`AddPersistentListener` leaves the call at `UnityEventCallState.RuntimeOnly`, so the binding is
|
|
17
|
+
correct but dormant outside Play mode: switching locale in the Editor changes nothing, and it
|
|
18
|
+
stays that way through a save and reload. Fix it with the public
|
|
19
|
+
`UnityEventBase.SetPersistentListenerState`:
|
|
20
|
+
```csharp
|
|
21
|
+
UnityEventTools.AddPersistentListener(lse.OnUpdateString, setText);
|
|
22
|
+
var index = lse.OnUpdateString.GetPersistentEventCount() - 1;
|
|
23
|
+
lse.OnUpdateString.SetPersistentListenerState(
|
|
24
|
+
index, UnityEngine.Events.UnityEventCallState.EditorAndRuntime);
|
|
25
|
+
```
|
|
26
|
+
- Persistent listeners **MUST** point to a method on a `UnityEngine.Object`; lambdas will fail.
|
|
27
|
+
- **Then confirm the binding is live, don't assume it.** Wiring that looks right in the Inspector
|
|
28
|
+
but does nothing is the characteristic failure of this step. All of the read-back you need is
|
|
29
|
+
public API on the event, so none of this requires touching serialized fields:
|
|
30
|
+
|
|
31
|
+
| Check | Call | Expect |
|
|
32
|
+
|---|---|---|
|
|
33
|
+
| Something was wired | `GetPersistentEventCount()` | `> 0` |
|
|
34
|
+
| It points at the text component | `GetPersistentTarget(i)`, `GetPersistentMethodName(i)` | the component, `set_text` |
|
|
35
|
+
| It will fire while authoring | `GetPersistentListenerState(i)` | `EditorAndRuntime` |
|
|
36
|
+
| It actually updates the label | `lEvent.RefreshString()` | the text value changes |
|
|
37
|
+
|
|
38
|
+
Do all four, because a binding that is wired but never fires reads as done while leaving the
|
|
39
|
+
label unlocalized.
|
|
40
|
+
- **Initialization & Refresh**:
|
|
41
|
+
- `LocalizationEditorSettings.CreateStringTableCollection` expects a **directory path** (e.g., `Assets/Localization`), not a full asset path.
|
|
42
|
+
- Always call `lEvent.RefreshString()` after assigning a `LocalizedString` reference programmatically to update the UI immediately.
|
|
43
|
+
- Keys must exist with a **non-empty value in every table** of a collection (en, de, ja, …). A key
|
|
44
|
+
that exists with an empty value is the common gap, and it is not silent: the package prints its
|
|
45
|
+
own "No translation found for …" text **into the game UI**, so the shipped screen shows a
|
|
46
|
+
developer message. Do not eyeball this. Run the completeness check below.
|
|
47
|
+
- **Verification**: After modifying tables or addressables, run `AddressableAssetSettings.BuildPlayerContent()` and switch the Editor locale to verify changes. Check `LocalizationSettings.Instance` status after activation.
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
## Recommended translation strategy
|
|
2
|
+
To efficiently translate an existing project, follow this multi-step workflow:
|
|
3
|
+
|
|
4
|
+
1. **Extraction & Component Setup:**
|
|
5
|
+
- **Find all occurrences. There are two separate hiding places, and scanning one misses the other.**
|
|
6
|
+
- **Authored text** sits on components in scenes and prefabs: legacy `UnityEngine.UI.Text` and
|
|
7
|
+
TextMeshPro (`TMP_Text`, the base of `TextMeshProUGUI` and `TextMeshPro`). Walk **both**
|
|
8
|
+
families. Measured on a real project: `FindObjectsByType<Text>` found 1 component while
|
|
9
|
+
`FindObjectsByType<TMP_Text>` found 13, so a legacy-only pass reports success having done
|
|
10
|
+
almost nothing.
|
|
11
|
+
- **Text composed in code** never appears on a component at edit time, so no scene walk can see
|
|
12
|
+
it. `scoreLabel.text = $"EXP {value}"` is invisible to every component-based scan and is the
|
|
13
|
+
string that survives a "finished" localization pass. Find it in the C# instead:
|
|
14
|
+
```bash
|
|
15
|
+
# Assignments and SetText calls that carry a string literal.
|
|
16
|
+
grep -rnE '\.text\s*(=|\+=)\s*\$?"|SetText\(\s*\$?"' --include='*.cs' Assets/
|
|
17
|
+
```
|
|
18
|
+
That pattern catches plain, interpolated, concatenated and `+=` forms plus `SetText`, and
|
|
19
|
+
deliberately does not match `label.text = someVariable` or `label.text = Localize("KEY")`
|
|
20
|
+
(nothing to extract at the first, already routed at the second). Its blind spot is a literal
|
|
21
|
+
held in a variable or const declared elsewhere; if the count looks low for the project, grep
|
|
22
|
+
that file's string literals too.
|
|
23
|
+
- **Report what you did not convert.** A composed string usually needs a smart string or a format
|
|
24
|
+
argument, which is a judgment call, and some are genuinely not worth localizing. Whichever you
|
|
25
|
+
choose, list every site the scan found alongside whether it was converted, and why not if it
|
|
26
|
+
wasn't. Reporting "localized 24 strings" while nine found sites went untouched is the failure
|
|
27
|
+
mode this list exists to prevent: the work looks finished and the gap only surfaces in a
|
|
28
|
+
screenshot from another locale.
|
|
29
|
+
- **Shared Table:** Create a central String Table (e.g., `UIStrings`) with the base language and a "Context" column for each key to guide translators.
|
|
30
|
+
- **Attach Components:** For every UI element found, attach a `LocalizeStringEvent` (for text) and the skill's `LocalizedFontAsset` component (for font swapping).
|
|
31
|
+
- **Validation:** Ensure these components are set up with persistent listeners (`EditorAndRuntime`) so they update in the Editor immediately when the locale changes.
|
|
32
|
+
|
|
33
|
+
2. **Context-Aware Translation:**
|
|
34
|
+
- **Translate:** Once the table is populated, provide translations for each locale.
|
|
35
|
+
- **Context is King:** Always refer to the "Context" column or inspect the UI layout to ensure the translation fits the intended meaning and space.
|
|
36
|
+
- **Grammar & Tone:** Ensure the tone matches the game's style. For example, use imperative verbs for buttons (e.g., German: "Lauf!" instead of "Laufen") and correct pluralization for labels (e.g., "Punkte" instead of "Punkt").
|
|
37
|
+
|
|
38
|
+
3. **Quality Assurance (QA):**
|
|
39
|
+
- **Switch locale:** Through `eval`, run `LocalizationSettings.SelectedLocale = LocalizationSettings.AvailableLocales.GetLocale("de");` for each target locale in turn, because a script call is repeatable and doesn't depend on an Editor window being open.
|
|
40
|
+
- **Visual Inspection:** Methodically inspect every prefab and scene in the base language and all target languages.
|
|
41
|
+
- **Layout Fit:** Check for text overflows or "tofu" (missing glyphs). Adjust font sizes or use `ContentSizeFitter` if strings are too long.
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
# Localization error messages
|
|
2
|
+
|
|
3
|
+
Exact error strings this skill's steps can produce, with the root cause and the fix.
|
|
4
|
+
|
|
5
|
+
| Error | Root cause | Resolution |
|
|
6
|
+
|---|---|---|
|
|
7
|
+
| `CS0118: 'UI' is a namespace but is used like a type` | An unqualified UI type name such as `Image` or `Mask` resolves to the `UnityEngine.UI` namespace. | Fully qualify the type, for example `UnityEngine.UI.Image`. |
|
|
8
|
+
| `OperationException: Failed to load sub-asset` | An Asset Table entry points at an asset inside a `Resources/` folder, which Addressables can't load as a sub-asset. | Copy the asset out of `Resources/`, mark the copy Addressable, and point the table entry at the copy's GUID. |
|
|
9
|
+
| Text starting `No translation found for` shown in the game UI | The key has no entry, or an empty value, in the selected locale's table. | Run the table completeness check in `table-completeness-check.md` Fill the gaps for the keys and locales the user asked for, and report the rest without changing them. |
|
|
10
|
+
| `NullReferenceException` on the first TMP call, for example `TMP_FontAsset.CreateFontAsset` | TMP Essential Resources were never imported, so `TMP_Settings.instance` is `null`. | Import them non-interactively as in `cjk-fonts.md`. |
|
|
11
|
+
| `UnassignedReferenceException` on a font asset, or glyphs show as squares (tofu) | The font asset's material or atlas texture wasn't saved as a sub-asset, or the font lacks the locale's glyphs. | Follow the font repair steps in `api-notes.md` and the font setup in `cjk-fonts.md`. |
|
|
12
|
+
| `OperationCanceledException` from `LocalizeAll` | The user clicked Cancel in the confirmation dialog. | Report it as a cancellation. Don't retry or bypass the dialog. |
|