-
StoreKitとBackground Assetsによるゲーム内コンテンツの提供
Steam Asset Converterと、アプリ内課金をサポートする新しいUnityプラグインを活用して、クロスプラットフォーム開発をシンプルにしましょう。内容を必要なもののみに絞ることのできる言語別のアセットパックにより、ゲームを軽量化して最適なプレイ体験を提供することができます。
関連する章
- 0:01 - Introduction
- 0:33 - Background Assets
- 1:35 - Localized asset packs
- 3:14 - Convert Steam depots to asset packs
- 4:15 - Unity plug-ins
- 5:52 - StoreKit and Background Assets sample code
- 8:25 - Game presence
- 9:10 - Next steps
リソース
関連ビデオ
WWDC26
WWDC25
Meet with Apple
WWDC22
-
このビデオを検索
こんにちは、Samです StoreKitチームの エンジニアです。
今回のセッションでは 新しいツールを詳しく紹介します。 Apple プラットフォームで最高のゲームを 制作するためのツールです。 まず、Background Assets の アップデートを説明します。 次に、新しい Unity プラグインを紹介します。 優れたアプリ内購入体験を 提供するためのプラグインです。 最後に、プレゼンスを高める方法を 確認します。 App Store と Apple Games app での 方法です。 では、Background Assets の アップデートから始めましょう。
私が制作中の The Coast という アプリを紹介します。 多彩なレベルが詰まった ゲームです。 ゲームコンテンツに加え、 多くの音声データも含まれており、 ビデオ、テクスチャ、 機械学習モデルも含まれています。 ただし、これらのアセットが必要になるのは 特定の場面だけです。 すべてのアセットを最初から ダウンロードして ストレージを消費するよりも、 Managed Background Assets が プレイヤーの時間とストレージを節約します。 必要なタイミングでシステムが アセットパックを自動ダウンロードし、 プレイヤーに優れた ゲーム体験を提供します。 App Storeのアプリでは、 Appleが1アプリあたり最大200GBの アセットをホスティングします。 デベロッパプログラムの メンバーシップに含まれています。 Apple-Hosted Background Assetsは iOS、iPadOS、macOS、tvOS、 visionOS 26 から利用できます。 セットアップと API 統合の 詳細については、 こちらのセッションを ご確認ください。 WWDC25 の「Discover Apple-Hosted Background Assets」です。
iOS 27 では Managed Background Assets がさらに強化されます。 ローカライズされた アセットパックが追加されます。 ローカライズされたアセットパックにより アセットのサイズを大幅に削減できます。 プレイヤーがダウンロードする アセットの量が減ります。 システムがプレイヤーの 優先言語を識別し、 設定で選択された言語に基づいて、 その言語のゲームアセットのみを 配信します。 ユーザーが選択した言語の アセットパックがない場合、 システムが自動的に 最も近い言語に切り替えます。
The Coast では英語を 主要言語に設定し、 フランス語とドイツ語も 利用できるようにしています。 ローカライズされたアセットパックがない場合、 システムはすべてのアセットを プレイヤーのデバイスにインストールします。 アセットパックをローカライズした後、 プレイヤーがシステムの言語設定を ドイツ語にすると、 システムはドイツ語の アセットパックのみをインストールします。 アセットパックをローカライズすることで ゲームに必要なストレージが 大幅に削減されます。
システム言語設定として English-UK を選択した場合、 システムは English-UK の アセットパックがないことを認識します。 フォールバックとして、優先言語の ベース言語アセットパックが使用されます。 この場合は English-US が デフォルトになります。 別のシナリオとして、システム言語を スペイン語に設定した場合、 The Coast にはスペイン語の アセットパックがありません。 また、類似する 地域バリアントもありません。 そのためシステムは アプリの主要言語に フォールバックします(英語)。
ゲームでローカライズされた アセットパックをサポートするには、 アセットパックのマニフェスト JSONファイルを言語タグで更新します。
Steam でゲームを開発している場合、 デポを使ってゲームのアセットを 管理しているかもしれません。 Steam デポをアセットパックに より簡単に変換できるようになりました。 Apple プラットフォームでの ゲーム配信に活用できます。 macOS で Steam アセット コンバータを使用するには、 Xcode 27 をインストールして、 コマンドラインで xcrun ba-package convert を実行します。 3つの引数を渡します。 アセットパックの ID、 言語 ID(該当する場合)、 そして希望する ダウンロードポリシーです。
Steamマニフェストのビルドスクリプトを 入力として渡すと、 指定した名前のアセットパック マニフェストが出力されます。 同じツールは LinuxとWindowsでも 近日公開予定です。
アセットパックマニフェストが 作成されたら、 ba-package を再度実行して アセットパックアーカイブを生成します。 新しいマニフェストファイルを 入力として使用します。 アセットパックアーカイブが 出力されます。
パッケージ化されたアセットパックアーカイブを ゲームで使用する準備ができました。 Unity で開発している場合は、 Background Assets の アップデートも利用できます。 2 つの新しいプラグインを 紹介できることを嬉しく思います。 Apple Unity プラグインの ポートフォリオに追加されます。 Background AssetsとStoreKitです。 Apple Unityプラグインにより ゲームが最新機能を活用できます。 Apple プラットフォーム全体の ゲームサービスです。
Background AssetsとStoreKit プラグインは今すぐダウンロードできます。 GitHub上の Appleの 既存プラグインと一緒に公開されています。 リポジトリはこのセッションの リソースから確認できます。 プラグインのビルドと インストール手順も掲載されています。
新しい Unityプラグインを ダウンロードしたら、 同じ Pythonスクリプトで ビルドできます。 他のApple Unityプラグインの ビルドにも使われているスクリプトです。 両方の新しいプラグインは C# ベースの Unity APIを公開します。 ネイティブフレームワークへの ブリッジとして機能します。
プラグインのビルド、パッケージ化、 テストを行うには、 Xcode 27、Python 3、 Unity 2022 LTS以降を使用します。 Meet with Appleのセッションも ご確認ください。 "Chart your game's course to Apple platforms" プロジェクトのセットアップと 設定の詳細を確認できます。 Appleの他の Unityプラグインを 使った設定方法です。 ゲームのビルドにおける ベストプラクティスについては、 「Plug-in and play: Add Apple frameworks to your Unity game projects」 WWDC22 をご確認ください。
プラグインをプロジェクトに インストールしたら、 Unityエディタで ゲームを開きます。
プロジェクトに StoreKitを採用すると、 Appleプラットフォーム全体で 世界中のプレイヤーにリーチでき、 アプリ内購入を提供できます。 App Store の安全で信頼性の高い 決済プラットフォームを通じて。
C# 版の StoreKit APIで 一般的なフローにアクセスできます。 アプリ内購入商品の取得や マーチャンダイジングなどです。 Product API を使用します。 また、ゲーム内の商品の 購入を開始することもできます。 Purchase API を使って システムの支払いシートを表示します。 購入後は PurchaseResult を使って 購入が成功したか確認します。 トランザクションが IsVerified かどうかもチェックします。 購入したコンテンツを プレイヤーに提供し、 Finish() を呼び出して トランザクションを完了します。
ゲームのライフサイクル全体を通じて、 Transaction.Updates シーケンスで 新しいトランザクションを監視します。 このシーケンスを通じて トランザクションが送出されます。 システムがトランザクションを 作成または更新するたびです。 アプリ外または他のデバイスで 発生したトランザクションも対象です。 ここに OnUpdateハンドラがあります。 アプリ起動時にトランザクション更新の リスナー内で呼び出されます。 消耗型の場合、まずトランザクションが 取り消されていないか確認し、 その後カスタマーに アクセスを付与します。 非消耗型とサブスクリプションの場合、 currentEntitlements が真実の情報源です。 カスタマーの権限を示すものです。 返金済み、取り消し済み、 期限切れの状態を自動でフィルタリングし、 非消耗型とサブスクリプションに 対応しています。 トランザクションが確認済みであれば カスタマーにアクセスを付与できます。 最後に、verifiedTransaction で Finish() を呼び出します。
プレイヤーがコンテンツを購入したら Background Assetsプラグインを使用します。 アセットパックがローカルで 利用可能か確認し、 プレイヤーへのコンテンツ配信を 開始します。 ダウンロードが必要な場合は、 ダウンロードの進捗を監視し ゲームの UI を更新できます。 ステータスアップデートを 反復処理することで、 DownloadStatusUpdatesAsyncメソッドが 返すアップデートを取得します。
新しいプラグインでゲームを 設定したら、 Xcode にプロジェクトを エクスポートします。 そして強力なテスト機能を 活用します。 Xcode の StoreKit Testingと Background Assets モックサーバーです。 Xcode で StoreKit Testing を 設定するには、 StoreKit 設定ファイルを作成し テスト商品を追加します。 次に、ターゲットのスキームを 編集して、 を選択し、 ドロップダウンで StoreKit 設定ファイルを選択します。 ここでフォルダも選択できます。 モックサーバーがゲームに送信する アセットパックの保存先フォルダです。
ビルドと実行の準備が完了しました。 Xcode 27 でプロジェクトを実行すると、 Background Assets モックサーバーが 自動的に起動し デバッグセッションにアタッチされます。 ゲームにアセットを配信します。 サンドボックステストも利用可能で ユーザー体験のテストに役立ちます。 App Store Connect で設定した 商品を使ったテストです。
App Store へのゲーム提出準備が できたら、 商品ページのヘッダーや検索結果に 新しいビジュアルを追加できます。 ゲームを際立たせるためです。 App Store の検索結果に追加した 画像や動画は、 Apple Games app にも表示されます。 ゲームを視覚的にアピールする方法が さらに広がります。 WWDC26 の「Enhance your presence on the App Store」をご確認ください。 これらのアセットの設定方法について 詳しく説明しています。
最後に、ゲームが公開されて プレイヤーが新しいコンテンツを購入すると、 iOS 27 の再設計されたシステム 支払いシートが使用されます。 ランドスケープモードでも きれいに表示されます。 コンテンツをアンロックしながら ゲームを続けられます。 まとめる前に、 開発ワークフローを改善するための 次のステップを確認しましょう。 プレイヤーにさらに優れた ゲーム体験を提供するためです。
アプリのサイズをさらに削減し、 コンテンツをプレイヤーに 効率的に配信するには、 App Store Connectでアセットパックの ローカライズ版をアップロードします。 ネイティブの Managed Background Assets の パワーを活用し、 新しい Apple Unityプラグインで StoreKit APIをUnity ゲームに導入します。 ゲームの更新が完了したら、 機能をハイライトする 方法を計画します。 App StoreとApple Gamesアプリで 新しい画像や動画を使ってアピールします。 ゼロから始める場合でも 長年の積み重ねがある場合でも、 これらの新機能により 世界中の何百万人ものプレイヤーに Appleプラットフォームで リーチできます。 ご視聴ありがとうございました ゲームを次のレベルへ引き上げましょう!
-
-
3:06 - Asset pack manifest for a localized asset pack
// Asset pack manifest { "assetPackID": "voice-english", "downloadPolicy": { /* … */ }, "language": "en-US", "sourceRoot": ".", "fileSelectors": [ /* … */ ], "platforms": [ /* … */ ] //… } -
3:27 - Convert a Steam depot to an asset pack manifest
# Convert a Steam depot to an asset pack manifest xcrun ba-package convert --asset-pack-id voice-english -l en-US --on-demand voice-english.vdf -o voice-english.json -
3:28 - Convert an asset pack manifest to an asset pack archive
# Convert an asset pack manifest to an asset pack archive xcrun ba-package voice-english.json -o voice-english.aar -
5:52 - Fetch and purchase products with the StoreKit plug-in
// Fetch and purchase products with the StoreKit plug-in using UnityEngine; using Apple.StoreKit; async void Start() { var products = await Product.FetchProducts(new[] { "com.thecoast.capecod" }); } -
6:01 - Fetch and purchase products with the StoreKit plug-in
// Fetch and purchase products with the StoreKit plug-in using UnityEngine; using Apple.StoreKit; async void Purchase(Product product) { var result = await product.Purchase(); if (result.Result == PurchaseResult.ResultEnum.Success && result.TransactionVerification.IsVerified) { // Unlock access to purchased content result.TransactionVerification.SafePayload.Finish(); } } -
6:23 - Listen for Transaction updates with the StoreKit plug-in
// Listen for Transaction updates with the StoreKit plug-in using UnityEngine; using Apple.StoreKit; public static class TransactionListener { public static void Initialize() => Transaction.Updates += OnUpdate; async void OnUpdate(VerificationResult<Transaction> result) { if (!result.IsVerified) return; var verifiedTransaction = result.SafePayload; // Consumables are not in CurrentEntitlements, so handle them inline if (verifiedTransaction.ProductType == ProductType.ProductTypeEnum.Consumable) { if (verifiedTransaction.RevocationDate != null) { // Revoke the consumable identified by verifiedTransaction.ProductId } else { // Grant access to the consumable } }else { // Non-consumables and subscriptions: re-read CurrentEntitlements as source of truth await foreach (var verificationResult in Transaction.GetCurrentEntitlements()) { if (!verificationResult.IsVerified) continue; // Grant access to the product } } verifiedTransaction.Finish(); } } -
7:13 - Download asset packs with the Background Assets plug-in
// Download asset packs with the Background Assets plug-in using Apple.BackgroundAssets; using UnityEngine; async void LoadTutorial(string language) { try { string assetPackId = $"tutorial-{language}"; AssetPackManifest manifest = await AssetPackManager.GetManifestAsync(); AssetPack assetPack = manifest.GetAssetPack(assetPackId); CancellationTokenSource tokenSource = new CancellationTokenSource(); _ = Task.Run(async () => { await foreach (AssetPackManager.DownloadStatusUpdate statusUpdate in AssetPackManager.DownloadStatusUpdatesAsync(assetPackId)) { // Update download progress in UI } }, tokenSource.Token); await AssetPackManager.EnsureLocalAvailabilityOfAssetPackAsync(assetPack); tokenSource.Cancel(); // Start tutorial with the locally available assets } catch (Exception exception) { // Handle the exception } }
-
-
- 0:01 - Introduction
New tools for building games on Apple platforms: updates to Background Assets, new Unity plug-ins for In-App Purchase, and ways to enhance your presence on the App Store and Apple Games app.
- 0:33 - Background Assets
Apple-Hosted Managed Background Assets save players time and storage by downloading asset packs only when needed. Now with Apple-hosting, up to 200 GB per app is included in the Developer Program.
- 1:35 - Localized asset packs
Localized asset packs greatly reduce the size of assets that players need to download by allowing the system to identify the player’s preferred language selected in Settings and only deliver assets for your game in that language.
- 3:14 - Convert Steam depots to asset packs
Learn how to bring your Steam depots into asset pack manifests and asset pack archives to ship along with your game on Apple platforms.
- 4:15 - Unity plug-ins
Two new Apple Unity plug-ins: Background Assets and StoreKit expose C# APIs that bridge to the native frameworks. Build and test with Xcode 27, Python 3, and Unity 2022 LTS or later.
- 5:52 - StoreKit and Background Assets sample code
Examples of how to use the C# version of the native StoreKit and Background Assets APIs in your game.
- 8:25 - Game presence
Make your game stand out with new visuals for your product page header and search results.
- 9:10 - Next steps
Ways to go further — upload localized asset packs in App Store Connect to reduce app size, adopt new Unity plug-ins, and highlight features with new image and video assets in the App Store and Apple Games app.