Communitygithub.com

unity-technologies/build-live-game

Unity Gaming Services を使用してライブゲームを構築および運用します。バトルパス、実績、プレイヤーの進行、クラウドセーブ、リーダーボード、マッチメイキング、仮想経済、サーバー権威ロジック、アンチチート、プレイヤーアカウントと認証、リモート設定、フィーチャーフラグ、A/Bテスト、分析、クラウドリソースデプロイなど、バックエンド主導の機能の実装、接続、デバッグが必要な場合に使用します。

build-live-game とは?

このスキルは、Unity Gaming Services (UGS) を使用してライブゲームを構築および運用するための包括的なガイドです。主に、プレイヤー認証、クラウドセーブ、リモート設定、エコノミー、クラウドコード、そしてマルチプレイヤー機能といった主要なUGSパッケージの初期化パターン、アーキテクチャ図、クイックリファレンスを提供します。また、検証手順、デプロイチェックリスト、アセットストアのビルディングブロック、そしてレディメイドの機能ブループリントも含まれており、開発者はこれらを利用して効率的にライブオペレーション機能を実装できます。このスキルは、Claude CodeやClineのようなAIコーディングエージェントがUnityプロジェクト内でUGSの統合を案内する際に特に役立ち、信頼性の高いバックエンド機能を持つライブゲームの迅速な立ち上げを支援します。

対応~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/unity-technologies/skills/tree/main/skills/build-live-game

お気に入りのAIに質問する

このエージェントスキルを事前に読み込んだ状態で新しいチャットを開きます。

ドキュメント

Unity Gaming Services でライブゲームを構築する

UGS パッケージ

パッケージ最小バージョン目的
com.unity.services.core1.16.0初期化、依存関係グラフ
com.unity.services.authentication3.6.1プレイヤーサインインとID
com.unity.services.cloudcode2.10.3サーバー権威の C# モジュール
com.unity.services.cloudsave3.4.0プレイヤー別および共有のキー・バリューストレージ
com.unity.remote-config4.2.5サーバーサイドのゲーム設定
com.unity.services.deployment1.7.2エディタからクラウドリソースをデプロイ
com.unity.services.tooling1.4.1アクセス制御とゲームオーバーライド
com.unity.services.apis1.1.1すべてのUGSサービス用の生成RESTクライアント

初期化パターン

すべてのUGSゲームは同じ方法で始まります。com.unity.services.core が最初に初期化され、その後プレイヤーがサインインします:

using Unity.Services.Core;
using Unity.Services.Authentication;

await UnityServices.InitializeAsync();
await AuthenticationService.Instance.SignInAnonymouslyAsync();
// 他のすべてのサービスが利用可能になります

InitializeAsync() が完了すると、サービスシングルトン(例:CloudSaveService.Instance、CloudCodeService.Instance)が使用可能になります。

パッケージマップ

基盤

パッケージ目的シングルトン / エントリポイント
Core初期化、依存関係グラフ、コンポーネントレジストリUnityServices.InitializeAsync()
Authenticationプレイヤーサインイン(匿名、ソーシャル、Unity、ユーザー名/パスワード)、IDAuthenticationService.Instance
Services APIsすべてのUGSサービス用の生成RESTクライアント、サービスアカウントによる管理APIアクセス直接APIクラス

プレイヤーデータと設定

パッケージ目的シングルトン / エントリポイント
Cloud Saveプレイヤー別のキー・バリューデータ(Default、Public、Protected)およびゲーム全体のCustomデータCloudSaveService.Instance.Data.Player / .Data.Custom
Remote Configサーバーサイドのゲーム設定、フィーチャーフラグ、JSON定義RemoteConfigService.Instance
Economy仮想通貨、インベントリアイテム、購入、ストアEconomyService.Instance

サーバーロジックとセキュリティ

パッケージ目的シングルトン / エントリポイント
Cloud Code信頼できる書き込みと検証のためのサーバー権威 C# モジュールCloudCodeService.Instance → CallModuleEndpointAsync
Toolingアクセス制御(.ac)とゲームオーバーライド(.ugo)ファイルの作成とデプロイエディタのみ(Deployment Window)
DeploymentUnity エディタからクラウドリソース(.rc、.ac、.ccmr、.lb など)をデプロイエディタのみ(Services > Deployment)

ソーシャルと競技

パッケージ目的シングルトン / エントリポイント
Multiplayerセッション、マッチメイキング、ロビー。ビルディングブロック:マルチプレイヤーセッション、マッチメーカーセッション、サーバーセッションMultiplayerService.Instance
Leaderboardsスコア提出、ランキング、ティア、バージョン履歴。ビルディングブロック:リーダーボードLeaderboardsService.Instance

テレメトリー

パッケージ目的シングルトン / エントリポイント
Analyticsカスタムイベント、標準イベント、同意管理AnalyticsService.Instance

アーキテクチャ — パッケージの組み合わせ方

                    UnityServices.InitializeAsync()
                              │
                              ▼
                     AuthenticationService
                    (サインイン → PlayerId)
                              │
              ┌───────────────┼───────────────┐
              ▼               ▼               ▼
        Remote Config     Cloud Save      Economy
      (ゲーム設定、    (プレイヤー状態、 (通貨、
       定義、          進行、             インベントリ、
       フィーチャー    設定)             購入)
       フラグ)
              │               │               │
              └───────┬───────┘               │
                      ▼                       │
                 Cloud Code                   │
              (サーバー権威                   │
               書き込み、検証、      ◄─────────┘
               アンチチートロジック)
                      │
              ┌───────┼───────┐
              ▼       ▼       ▼
         Cloud Save  Economy  Leaderboards
         (Protected  (サーバー (スコア
          書き込み)  付与)    提出)

重要な原則: ゲームの整合性に影響を与えるデータ(XP、報酬、通貨)は、Cloud Code モジュールを介して書き込みをルーティングします。直接のクライアント書き込みは、機密性の低いデータ(設定、表示設定)にのみ適しています。

コアサービス — クイックリファレンス

Authentication

パッケージ: com.unity.services.authentication (>= 3.6.1)

プレイヤーのIDを処理します。サインイン方法:匿名、ソーシャルプロバイダー(Google、Apple、Steam、Facebook、Oculus など)、Unity ブラウザ、ユーザー名/パスワード、デバイスコードフロー。

サインイン後:PlayerId と PlayerName が利用可能になります。すべてのサインイン方法は SignedIn イベントを発火します。PlayerAccountService(Unity ブラウザサインイン用)は 別のアセンブリ(Unity.Services.Authentication.PlayerAccounts)にあります。

Cloud Code

パッケージ: com.unity.services.cloudcode (>= 2.10.3)

信頼できる操作のために、サーバーサイドの C# モジュール(.NET 9)を実行します。モジュールは .ccmr ファイルとしてデプロイされます。クライアントは次のように呼び出します:

var result = await CloudCodeService.Instance.CallModuleEndpointAsync<TResult>(
    "ModuleName", "FunctionName", args);

本番環境では、JavaScript スクリプトよりも C# モジュールを推奨します。モジュールは、サブスクリプションを介したリアルタイムプッシュメッセージ、イベント駆動型トリガー、マルチプレイヤーセッションスコープもサポートしています。

Cloud Save

パッケージ: com.unity.services.cloudsave (>= 3.4.0)

3つのアクセスクラスに加えて、ゲーム全体のCustomデータを持つプレイヤー別のキー・バリューストレージ:

アクセスクラス読み取り書き込みユースケース
Default所有者所有者プライベート設定、環境設定
Public全員所有者公開プロフィール、表示名
Protected所有者サーバーのみ(Cloud Code)アンチチートデータ、サーバー付与された状態
Custom任意のプレイヤーサーバーのみ共有ゲーム状態、グローバル設定

値は JSON としてシリアライズされます。SaveItem による書き込みロック同時実行制御、QueryAsync によるサーバーサイドクエリ、およびバイナリファイルストレージをサポートしています。

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/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/localization

Sets up and configures Unity Localization, including locales, String/Asset Tables, CJK font support, and Addressables workflows. Use when the user wants to add languages to a project, translate UI text, support Asian (CJK) languages with TMP fonts, or mentions i18n, l10n, multilingual support, or making a game support multiple languages.

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.

関連スキル