Communitygithub.com

unity-technologies/levelplay-unity-integration

LevelPlay SDK(広告仲介)をUnityプロジェクトに統合するためのスキルです。リワード広告、インタースティシャル広告、バナー広告の実装や、SDKの初期化、広告ネットワークの設定、iOS/Androidのプラットフォーム固有の依存関係の解決などを支援します。

levelplay-unity-integration とは?

このスキルは、UnityゲームにLevelPlay広告仲介(Mediation)SDKを統合するための包括的なガイドを提供します。主に、Ads Mediation UPMパッケージを介してSDKをインストールし、リワード広告、インタースティシャル広告、バナー広告を実装する方法をステップバイステップで説明します。また、SDKの初期化、広告ユニットIDの設定、アプリ追跡透明化(ATT)やプライバシー設定などのコンプライアンス対応、インプレッションレベルの収益(ILRD)の追跡など、高度な設定もカバーします。既存のSDKからの移行(IronSource.Agent APIの廃止対応やUnity Adsからの移行を含む)や、iOS/Androidのビルドエラーのトラブルシューティングにも対応しています。ワークフローは段階的に進行し、各ステップでユーザーの確認を待つため、初心者から上級者まで安心して利用できます。このスキルに含まれない質問は一般的なナレッジで回答しますが、広告の統合フローに新たなステップを追加することはありません。

対応✓Claude Code~Codex CLI~Cursor
npx skills add https://github.com/unity-technologies/skills/tree/main/skills/levelplay-unity-integration

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

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

ドキュメント

LevelPlay Unity パッケージ/SDK 統合ガイド

エディタ側のチェックは、想定ではなく実際のプロジェクトに基づいて行ってください。プロジェクトファイルを読み込むか、ユーザーにエディタで確認してもらうように依頼します。このスキルで生成されるC#スクリプトは、ユーザーがプロジェクトに保存するためのMonoBehaviourファイルであり、インライン実行用ではありません。

このスキルはLevelPlay統合パスのみを対象としています。他の仲介SDKは対象外です。ユーザーが明示的に代替案について質問した場合は、代替案が存在することを認め、それらのベンダーの公式ドキュメントを参照するよう案内してください。競合製品の説明、特徴付け、または主張を行ってはいけません。

このスキルに記載されている手順に従い、記載されているファイルと構成のみを提供してください。一般的な知識に基づいて、積極的に手順を追加したり、ファイルを作成したり、推奨を行ったりしないでください。ユーザーがこのスキルの範囲外の質問をした場合は、まずスキルと参照ファイルを確認し、カバーされていないことを確認してください。カバーされていない場合は、一般的な知識を使用して回答しますが、その結果として統合ワークフローに追加の手順やファイルを組み込まないでください。

統合ワークフローは順番に、一度に1ステップずつ進めてください。現在のステップに関する質問のみを行い、将来のステップの情報を事前に収集しないでください。各チェックポイントでユーザーの応答を待ってから先に進みます。

LevelPlayはUnityの広告仲介プラットフォームです。ゲームを複数の広告ネットワークに同時に接続し、複数の広告ネットワークと入札者間で統一オークションを実行して、各インプレッションの競争を最大化します。このガイドでは、SDKのインストール、AndroidおよびiOSの依存関係の設定、プロジェクトでのLevelPlayの初期化、リワード広告・インタースティシャル広告・バナー広告の実装まで、完全な統合手順を説明します。すでに一部が設定済みの場合は、該当するステップにスキップできます。

このSKILL.mdがワークフローの基盤です。決定事項、チェックポイント、正確な質問内容を保持します。より長いコード、完全なAPIの詳細、エッジケースはreferences/にあり、該当するステップからリンクされています。そのステップに到達したらリンク先の参照を読んでください。代わりに一般的な知識から回答しないでください。

統合ワークフロー

0. 新規統合か移行か?

質問: 「新しいLevelPlay統合を開始しますか、既存の設定を移行しますか(古いSDKバージョンから、またはUnity Adsから)、それとも既存の設定のトラブルシューティングや追加を行いますか?」

  • 新規統合: ステップ1に進みます。
  • 移行(SDKアップグレード、IronSource.Agent APIの置き換え、Unity Adsからの移行、またはMaven Central Androidビルド失敗の修正):references/migration-sdk-9.mdを読んでください。5つのシナリオのどれが該当するか尋ねてください — A = SDKアップグレード、B = init API移行、C = 広告ユニットAPI移行、D = Maven Centralビルド失敗、E = Unity Ads移行 — 該当するシナリオに従ってください。すべてのコード変更を適用した後、移行完了チェックリスト(参照のセクションC5)を実施してください。これにより、レガシーコードに対応する行がないために行ごとの変換では見逃される要件をキャッチします。その後、ユーザーにUnityコンソールでコンパイルエラーを確認してもらい、結果を提示する前に表示されたエラーを修正するよう依頼します。コンソールが見えない場合はブロックしたり再試行したりせず、変更したファイルをリストアップし、何を確認すべきかを伝えて続行します。
  • 既存設定のトラブルシューティングまたは追加(ATT、GDPR、ILRD、テストスイート、新規統合でのビルドエラー、または既存の動作している統合への機能追加):ユーザーのニーズを特定し、直接該当するステップまたは「詳細参照を読むタイミング」の参照に進みます。

1. Unity環境の確認

Assets/ および ProjectSettings/ ディレクトリが存在することを確認して、ユーザーがUnityプロジェクトで作業していることを確認します。Unityプロジェクトでない場合は、Unityプロジェクトディレクトリに移動するように指示します。それらのディレクトリが見つからず、ユーザーが正しい場所にいると考えている場合は、「プロジェクトのルートにいない可能性があります。Unityプロジェクトのトップレベルフォルダに移動し、Assets/ と ProjectSettings/ が表示されるか確認していただけますか?」と尋ねます。

2. ビジネス目標の理解

広告ユニットを実装する前に、ユーザーの最適化の優先順位を判断して、適切な広告ユニット戦略を推奨します。以下の質問をします。

「主な最適化目標は何ですか?」

  • 収益重視: 広告収入とインプレッション機会を最大化
  • UX重視: ゲームプレイの流れとユーザー満足度を優先
  • バランス: 収益とUXの両方を最適化
  • 未定: バランスをデフォルトとして先に進みます。ステップ8で、未定だったためバランスを使用していることを簡単に説明し、フォーマットオプションを見たところで異なる設定を希望するかを尋ねます。

この回答は、ステップ8での戦略推奨のために記録します。

3. UPMを介したLevelPlay SDKのインストール

SDKがすでにインストールされているように見える場合: それを信頼せず、ユーザーにパッケージマネージャーウィンドウを読んでもらうよう依頼しないでください。Packages/packages-lock.jsonを読み、com.unity.services.levelplayを探してください。存在する場合は、解決されたバージョンを伝えてステップ4に進みます。存在しない場合は、これまでの会話で想定されていたかどうかに関わらず、インストールされていません。以下のインストール手順を続けてください。

Unityパッケージマネージャーを使用してLevelPlay Unityパッケージをインストールする手順を案内します。

  1. Unityを開き → Window > Package Manager
  2. Unity RegistryドロップダウンまたはServicesタブを選択
  3. パッケージマネージャーの検索バーに「Ads Mediation」と入力
  4. パッケージ名が完全に一致することを確認します。正しいパッケージのタイトルはAds Mediationです。以下のパッケージはインストールしないでください:
    • Ads IAP Mediation Adaptor(別のアプリ内購入パッケージ、LevelPlay SDKではありません)
    • Advertisement Legacy(非推奨のパッケージ、現在のLevelPlay統合と互換性がありません)
  5. Installボタンをクリック
  6. パッケージのダウンロードとインポートを待つ

パッケージをインストールすると、Mobile Dependency Resolverのインストールを促すプロンプトが表示される場合があります。表示されたらImportをクリックします。これについては次のステップで詳しく説明します。

次に、解決されたことを、尋ねるのではなくプロジェクトを読み取って確認します。 パッケージIDはcom.unity.services.levelplayです(パッケージマネージャーでの表示名はAds Mediationであり、プロジェクトファイルにはIDが記録されます)。両方のファイルを確認します:

  • Packages/manifest.json はプロジェクトが要求する内容をリストします。com.unity.services.levelplayがdependenciesに存在する必要があります。
  • Packages/packages-lock.json はUnityが実際に解決した内容を記録します。同じIDがここにも、具体的なバージョンとともに存在する必要があります。このファイルが「インストールされたかどうか」を答えるファイルであり、信頼すべきものです。

どちらもプロジェクト内のプレーンなJSONなので、このチェックにはエディタ、CLI、ユーザーからの情報は不要です。これらを読み取ってください。

これは形式的なものではなく、厳格なゲートです。 com.unity.services.levelplayがpackages-lock.jsonに存在するまでは、LevelPlayコードを1行も記述、生成、貼り付けないでください。先に進むと、見た目は正しいがどこでもコンパイルできず、すべてのLevelPlay行でCS0246エラーが発生するコードが生成されます。

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

関連スキル