-
Desbloquea contenido del juego con StoreKit y los activos en segundo plano
Simplifica tu desarrollo multiplataforma con el Steam Asset Converter y un nuevo plug-in de Unity que te ayuda a implementar las compras dentro de la app. Descubre cómo aligerar tu juego y ofrecer una experiencia de juego excepcional con paquetes de activos específicos para cada idioma que te permiten proporcionar solo lo necesario.
Capítulos
- 0:01 - Introducción
- 0:33 - Activos en segundo plano
- 1:35 - Paquetes de activos localizados
- 3:14 - Convierte depósitos de Steam en paquetes de activos
- 4:15 - Plug-ins de Unity
- 5:52 - Código de muestra de StoreKit y activos en segundo plano
- 8:25 - Visibilidad del juego
- 9:10 - Próximos pasos
Recursos
Videos relacionados
WWDC26
Meet with Apple
WWDC25
WWDC22
-
Buscar este video…
-
-
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 } }
-