Communitygithub.com

unity-technologies/localization

Unity 로컬라이제이션 설정 및 구성을 위한 스킬입니다. 로케일, 문자열/에셋 테이블, CJK 폰트 지원, Addressables 워크플로를 포함합니다. 사용자가 프로젝트에 언어를 추가하거나, UI 텍스트를 번역하거나, 아시아어(CJK)를 지원하거나, i18n, l10n, 다국어 지원을 언급할 때 사용하세요.

localization란 무엇인가요?

이 스킬은 Unity 프로젝트에서 로컬라이제이션(Localization) 시스템을 설정하고 구성하는 방법을 상세히 안내합니다. 주요 기능으로는 로케일(언어) 추가, 문자열(String) 및 에셋(Asset) 테이블 관리, Addressables 통합, 그리고 CJK(중국어, 일본어, 한국어) 폰트 지원이 포함됩니다. 특히 CJK 언어의 경우 TMP 폴백 폰트(Fallback Fonts) 대신 에셋 테이블 기반 폰트 교체 방식을 권장하며, 이는 더 안정적이고 디버깅이 쉽습니다. 이 스킬은 Claude Code, Cursor, Codex 등 다양한 AI 코딩 에이전트와 호환되며, Unity 에디터 없이도 패키지 설치 여부를 확인하는 방법(`Packages/packages-lock.json` 파일 검사), 로컬라이제이션 설정 생성 및 활성화, 테이블 수정 시 에디터 알림 처리 등 실용적인 팁을 제공합니다. 또한 `LocalizeStringEvent` 컴포넌트를 통한 올바른 문자열 바인딩 방법과 런타임 언어 전환 시 `LocalizationSettings.SelectedLocale` 사용을 강조하여, 패키지의 공식 API를 우회하지 않도록 주의를 줍니다. 이 스킬은 게임이나 애플리케이션에 다국어 지원을 추가하려는 개발자에게 필수적인 가이드입니다.

지원 대상~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/unity-technologies/skills/tree/main/skills/localization

즐겨 사용하는 AI에게 물어보기

이 에이전트 스킬이 미리 로드된 새 채팅을 엽니다.

문서

이 가이드는 Unity 로컬라이제이션 설정 및 구성을 다룹니다. 로케일, 문자열 및 에셋 테이블, Addressables 통합, 에셋 테이블을 통한 CJK 폰트 지원을 포함합니다.

0. 패키지 설치 확인

다른 작업을 수행하기 전에, 먼저 Localization 패키지가 설치되었는지 확인합니다. 이 스킬의 많은 API는 패키지가 없으면 조용히 실패하거나 이해하기 어려운 오류를 발생시킵니다.

  1. 프로젝트를 읽어서 확인하고, 패키지 매니저에 묻지 마십시오. Packages/packages-lock.json에서 com.unity.localization을 찾으십시오. 이 파일은 Unity가 실제로 해결한 내용을 기록하며, 일반 JSON이고, 편집기나 비동기 호출 없이 읽을 수 있습니다. (Packages/manifest.json은 요청된 내용만 기록하므로, lock 파일을 확인하십시오.)
  2. 없으면 설치: UnityEditor.PackageManager.Client.Add("com.unity.localization").
  3. 적절히 대기하십시오. Client.Add와 Client.List는 비동기적입니다. 호출이 반환될 때 요청은 여전히 InProgress 상태이므로, 같은 구문에서 결과를 읽는 것은 아무 소용이 없습니다. IsCompleted를 폴링(busy-wait)하지 마십시오. 이는 실행 중인 메인 스레드를 차단합니다. 대신 설치를 실행한 후 반환하고, 나중 호출에서 packages-lock.json을 폴링하여 ID가 나타날 때까지 기다리십시오. 설치 시 도메인 리로드도 발생하므로, 처음 한두 번의 폴링은 실패할 수 있습니다. 새로 설치는 보통 몇 초 안에 완료됩니다.
  4. 어셈블리를 사용하기 전에 실제로 로드되었는지 확인하십시오. lock 파일이 어셈블리 준비 전에 작성될 수 있기 때문입니다:
    var t = System.Type.GetType(
        "UnityEngine.Localization.Settings.LocalizationSettings, Unity.Localization");
    return t != null ? "ready" : "not loaded yet";
    
    ready가 반환될 때만 진행하십시오.

1. 로컬라이제이션 설정 및 로케일

LocalizationEditorSettings.ActiveLocalizationSettings가 null이면, 찾거나 생성해야 합니다:

  1. 찾기: AssetDatabase.FindAssets("t:LocalizationSettings", new[] { "Assets" })를 사용합니다. 찾으면 첫 번째 것을 로드하여 LocalizationEditorSettings.ActiveLocalizationSettings에 할당합니다.
    • 항상 검색 폴더를 전달하십시오. 범위가 없는 FindAssets는 읽기 전용 패키지를 포함한 전체 프로젝트를 검색하므로, 패키지의 에셋을 반환하여 편집할 수 없는 대상을 가리킬 수 있습니다. 이는 이 스킬의 모든 FindAssets 호출에 적용됩니다.
  2. 생성: 찾지 못하면 새 인스턴스를 생성하고 Assets/Localization/LocalizationSettings.asset에 저장합니다. ScriptableObject.CreateInstance<LocalizationSettings>() 다음에 AssetDatabase.CreateAsset()를 사용합니다.
  3. 활성화: LocalizationEditorSettings.ActiveLocalizationSettings = settings를 설정합니다.
  4. 로케일: 로케일(en, fr, de 등)이 있는지 확인합니다. 없으면 생성하고 LocalizationEditorSettings.AddLocale(locale)을 사용하여 설정에 추가합니다.

2. 로컬라이제이션 테이블 수정

문자열 또는 에셋 테이블을 프로그래밍 방식으로 변경하려면 편집기에 알려야 합니다. 필요한 에셋 테이블이 프로젝트에 이미 존재하지 않는 한, 항상 생성하십시오.

안전한 채우기 패턴

데이터셋에서 테이블을 채울 때, Locale.Identifier.Code로 명시적으로 일치시킵니다. GetLocales()의 순서는 입력 데이터 배열과 일치한다고 보장되지 않습니다. 순서에 의존하면 디버깅이 매우 어려운 조용한 데이터 불일치가 발생합니다. 에셋 테이블의 경우, 에셋의 GUID를 사용합니다: table.GetEntry(sharedId) ?? table.AddEntry(sharedId, guid);.

새로 고침 및 알림

키를 추가하거나 값을 업데이트한 후에는 편집기에 내부 상태를 새로 고칠 수 있도록 알립니다. 이 단계를 건너뛰면 편집기가 다음 재임포트까지 오래된 데이터를 표시합니다.

  1. 각 수정된 Table에 대해 EditorUtility.SetDirty(collection), EditorUtility.SetDirty(collection.SharedData)를 호출합니다.
  2. Unity 6+ 알림: LocalizationEditorSettings.EditorEvents.RaiseCollectionModified(sender, collection);
  3. 마지막에 항상 AssetDatabase.SaveAssets()를 호출합니다.

3. UI 로컬라이제이션 및 레이아웃

네임스페이스 및 충돌

  • 항상 이름을 완전히 지정하십시오: UnityEngine.UI.Image, UnityEngine.UI.VerticalLayoutGroup, UnityEngine.UI.ScrollRect, UnityEngine.UI.Mask, UnityEngine.UI.CanvasScaler, UnityEngine.UI.GraphicRaycaster, UnityEngine.UI.ContentSizeFitter, UnityEngine.UI.LayoutRebuilder 등을 사용하십시오.
  • UnityEngine.UI는 네임스페이스이자 클래스 컨테이너이므로, 완전히 지정되지 않은 이름은 CS0118(네임스페이스를 타입처럼 사용)을 발생시킵니다. 완전한 이름 지정으로 이를 완전히 피할 수 있습니다.
  • 단일 인스턴스: 항상 GameObject.Find("YourCanvasName")으로 확인하고, 새로 만들기 전에 기존 것을 파괴하십시오.
  • 로케일 전환: 패키지를 사용하고, 미리보기와 런타임을 분리하십시오. 이 두 가지는 서로 다른 메커니즘입니다. 이를 혼동하는 것이 로케일 전환을 수동으로 구현하는 경우가 많은 이유입니다.
    • 작성 중 로케일 미리보기는 Localization Scene Controls 창(Window > Asset Management > Localization Scene Controls)을 사용하십시오. 이는 편집기 전용입니다. 런타임 기능이 아니므로, 게임 자체에 언어 설정이 필요할 때는 답이 아닙니다.
    • 런타임에 로케일 전환은 LocalizationSettings.SelectedLocale을 할당하십시오. 이것이 지원되는 진입점이며, LocalizeStringEvent를 통해 바인딩된 모든 것이 여기서 업데이트됩니다.
    • 게임이 시작되는 로케일을 고정하려면 Localization Settings 에셋에서 시작 로케일 선택기를 구성하십시오. SpecificLocaleSelector는 선택한 로케일을 강제하는 것입니다. 기본 체인은 그렇지 않으면 시스템 언어를 선택합니다.
    • 절대 로케일 상태를 수동으로 관리하지 마십시오. 실제 게임 내 언어 메뉴는 SelectedLocale을 설정하고 패키지가 변경 사항을 전파하도록 하는 한 괜찮고 예상됩니다. 금지된 것은 자체적인 "현재 언어" 변수를 추적하고, 문자열을 자체적으로 교체하거나, 패키지를 우회하는 디버그 드롭다운이나 메뉴입니다. 프로젝트의 다른 어떤 것도 이를 따르지 않기 때문입니다.

지역화된 문자열 이벤트 (강력한 바인딩)

  • 컴포넌트 유형 확인: 대상이 TextMeshPro인지 이전 UnityEngine.UI.Text인지 식별합니다.

  • 올바르게 바인딩: 공개된 UnityEngine.Localization.Components.LocalizeStringEvent 컴포넌트를 추가하고 직접 연결하십시오. StringReference를 테이블 항목으로 설정한 다음, OnUpdateString 리스너를 추가하여 텍스트 컴포넌트에 값을 할당합니다(TMP_Text.text for TextMeshPro, UnityEngine.UI.Text.text for legacy Text).

    UnityEditor.Localization.Plugins.TMPro.LocalizeComponent_TMPro 또는 그 UGUI 대응 항목을 리플렉션하지 마십시오. 이들은 (Localization 1.5.12 기준) internal이므로, 접근 제어를 우회하여 Unity가 안정성을 약속하지 않는 API에 도달하게 됩니다. 이는 패키지 릴리스에서 변경되거나 사라질 수 있습니다. LocalizeStringEvent는 공개되어 있으며, 명시적인 연결로 동일한 작업을 수행합니다.

  • 레이아웃 재구축: 지역화된 텍스트를 설정하거나 목록을 채운 후, UnityEngine.UI.LayoutRebuilder.ForceRebuildLayoutImmediate(parentTransform)를 호출하여 치수가 업데이트되도록 합니다.

4. 아시아 언어 폰트 지원 (CJK)

CJK 로케일에는 TMP 폴백 폰트를 피하십시오. 각 로케일별로 에셋 테이블 폰트 교체를 사용하십시오. 폴백은 글리프가 누락될 때 신뢰할 수 없고 디버깅하기 어렵습니다.

전제 조건: TMP Essential Resources를 임포트해야 함

TMP API를 건드리기 전에 이를 확인하십시오. 한 번도 임포트한 적 없는 프로젝트에서 TMP_Settings.instance는 null이고, TMP 호출은 유용한 정보를 제공하지 않는 NullReferenceException으로 실패합니다. TMP_FontAsset.CreateFontAsset가 그중 하나이므로, 폰트 생성은 첫 줄에서 오류와 함께 중단됩니다.

Individual skills in this repo

This repo contains 9 individual skills — each has its own dedicated page.

unity-technologies/2d-pixel-perfect

Sets up, diagnoses, and fixes pixel perfect 2D rendering in Unity projects. Use when working on any retro-style or pixel art 2D game.

unity-technologies/audio-setup-mixers

Scans the scene and audio assets to appropriately route Audio Sources into existing Audio Mixer Groups, classifying each source by what it plays. Use when the user asks about cleaning up mixer assignments, routing audio through a mixer, or which group a sound belongs in. Creating mixers and groups, and setting volumes, are not automated — the skill inventories what exists and asks the user to add anything missing.

unity-technologies/build-live-game

Build and operate a live game using Unity Services. Use when the user needs to implement, connect, or debug backend-driven features — battle passes, achievements, player progression, cloud saves, leaderboards, matchmaking, virtual economies, server-authoritative logic, anti-cheat, player accounts and authentication, remote configuration, feature flags, A/B testing, analytics, or cloud resource deployment. Triggers on live-ops, live service, backend, server authority, cloud code, cloud save, remote config, player data, retention, monetization loop, season pass, ranking, multiplayer sessions, lobbies, or any Unity Services integration.

unity-technologies/generate-editor-search-query

Generates Unity Search / Quick Search queries and opens the Unity Search window for read-only Unity Editor asset or scene-object lookup requests. Always use when the user asks to find, search, show, locate, filter, look up, query, or list concrete assets or scene objects in the current project or scene, even if Unity Search is not named. Covers materials, textures, prefabs, scenes, scripts, shaders, GameObjects, components, Lights, Cameras, UI objects, labels, paths, references, selected or named assets, and asset types. Also use when the user explicitly mentions Unity Search, Quick Search, Search window, open Search, or asks what Unity Search query to use. Do not use for general project overview, project structure, folder-purpose summaries, gameplay/system explanations, how-to programming questions, web search, repository text search, build logs, package installation, menu or settings search, modifying results, or non-Unity filesystem search unless the user explicitly asks to use Unity Search.

unity-technologies/implement-in-app-purchases

Implement, configure, and debug Unity In-App Purchases (IAP) — store connection, product catalog, consumable/non-consumable/subscription purchases, two-step pending-confirm flow, receipt validation, entitlement checking, restore transactions, Apple extensions (promotional purchases, Ask-to-Buy, code redemption), and Google Play extensions (subscription upgrade/downgrade), D2C Capabilities(direct to customer), 3rd party payment provider (Stripe/Coda) via Unity IAP/Unity Cloud. Use when the user needs to add, modify, debug, or migrate from native Android/iOS billing, 3rd party packages(RevenueCat/Adapty/Essential Kit/Unipay supported) to IAP. Triggers on microtransactions (MTX), monetization, real-money purchases, store purchases, buying items, support D2C, purchase via Stripe/Coda, migrate from native billing(Google's BillingClient or Apple's StoreKit/SKPaymentQueue/SKProduct)/RevenueCat/Adapty/EssentialKit/Unipay.

unity-technologies/initialize-ai-navigation

Sets up and configures the Unity AI Navigation system — NavMesh surfaces, NavMesh agents, obstacles, links, modifiers, areas and costs. Use when creating walkable navigation meshes, adding pathfinding agents, setting up patrol routes, configuring obstacle avoidance and carving, connecting separate NavMeshes with links, coupling navigation with animation, or troubleshooting navigation issues.

unity-technologies/levelplay-unity-integration

Integrates the LevelPlay Mediation SDK via the Ads Mediation UPM package. Use when a developer asks about adding ads to a Unity game, implementing rewarded, interstitial, or banner ads, setting up ad mediation, configuring ad networks, installing or updating the Ads Mediation package, troubleshooting LevelPlay namespace errors, resolving Android gradle or iOS CocoaPods dependency issues for ads, configuring ATT or privacy settings for ad compliance, tracking impression-level revenue (ILRD), initializing the LevelPlay SDK, or setting up ad unit IDs. Also use when a developer wants to monetize their Unity game with ads, asks how to get started with LevelPlay, ads, or mediation, or needs help with any part of the LevelPlay integration workflow including platform-specific setup for iOS or Android. Also use when upgrading the LevelPlay or IronSource SDK version, migrating from deprecated IronSource.Agent APIs, or migrating a game from Unity Ads to LevelPlay.

unity-technologies/manage-sprite-atlas

Manage SpriteAtlas using prebuild pipeline with IPreprocessBuildWithReport (DEFAULT approach). Use it to configure master atlases, variant atlases, texture settings, packing settings, and platform-specific configurations. Use when the user asks about creating sprite atlases, optimizing sprites, configuring atlas settings, adding sprites to atlases, creating variant atlases, implementing automated atlas generation, or runtime sprite atlas access. Always use prebuild approach unless user explicitly requests manual authoring.

unity-technologies/migrate-birp-to-urp

Plans, executes, and troubleshoots Unity projects moving from the Built-in Render Pipeline (BiRP/BIRP/Built-in RP) to the Universal Render Pipeline (URP). Use when the user asks to upgrade, convert, switch, or migrate a project, scene, material, or shader to URP/Universal Render Pipeline; fix pink or magenta materials after URP; convert Built-in materials/shaders; move a 2D project to URP 2D; review lighting, quality, post-processing, baked lightmaps, or reflection probes after URP; or diagnose visual problems after a render-pipeline migration.

관련 스킬