View in English

  • Apple 开发者
    • 入门汇总

    探索“入门汇总”

    • 概览
    • 学习
    • Apple Developer Program

    及时了解最新动态

    • 最新动态
    • 开发者你好
    • 平台

    探索“平台”

    • Apple 平台
    • iOS
    • iPadOS
    • macOS
    • Apple tvOS
    • visionOS
    • watchOS
    • App Store

    精选

    • 设计
    • 分发
    • 游戏
    • 配件
    • 网页
    • Home
    • CarPlay 车载
    • 技术

    探索“技术”

    • 概览
    • Xcode
    • Swift
    • SwiftUI

    精选

    • 辅助功能
    • App Intents
    • Apple 智能
    • 游戏
    • 机器学习与 AI
    • 安全性
    • Xcode Cloud
    • 社区

    探索“社区”

    • 概览
    • “与 Apple 会面交流”活动
    • 社区主导的活动
    • 开发者论坛
    • 开源

    精选

    • WWDC
    • Swift Student Challenge
    • 开发者故事
    • App Store 大奖
    • Apple 设计大奖
    • Apple Developer Centers
    • 文档

    探索“文档”

    • 文档库
    • 技术概述
    • 示例代码
    • 《人机界面指南》
    • 视频

    发布说明

    • 精选更新
    • iOS
    • iPadOS
    • macOS
    • watchOS
    • visionOS
    • Apple tvOS
    • Xcode
    • 下载

    探索“下载”

    • 所有下载
    • 操作系统
    • 应用程序
    • 设计资源

    精选

    • Xcode
    • TestFlight
    • 字体
    • SF Symbols
    • Icon Composer
    • 支持

    探索“支持”

    • 概览
    • 帮助指南
    • 开发者论坛
    • “反馈助理”
    • 联系我们

    精选

    • 《开发者账户帮助》
    • 《App 审核指南》
    • 《App Store Connect 帮助》
    • 即将实行的要求
    • 协议和准则
    • 系统状态
  • 快速链接

    • 活动
    • 新闻
    • 论坛
    • 示例代码
    • 视频
 

视频

打开菜单 关闭菜单
  • 专题
  • 所有视频
  • 关于

更多视频

  • 简介
  • 概要
  • 转写文稿
  • 代码
  • 通过 StoreKit 和后台资源解锁游戏内内容

    使用 Steam Asset Converter 和新的 Unity 插件,简化你的跨平台开发,并为 App 内购买项目提供更好的支持。了解如何通过特定于语言的资源包,精准地分发恰如所需的内容,从而让你的游戏更精简,并为玩家带来更出色的体验。

    章节

    • 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

    资源

    • Apple Unity Plug-Ins on GitHub
    • Background Assets
    • StoreKit
      • 高清视频
      • 标清视频

    相关视频

    WWDC26

    • 提升 App 在 App Store 上的表现

    WWDC25

    • 探索 Apple 托管的 Background Assets

    Meet with Apple

    • Chart your game's course to Apple platforms

    WWDC22

    • 即插即用:向你的 Unity 游戏项目添加 Apple 框架
  • 搜索此视频…

    你好 我是Sam 我是StoreKit团队的工程师 在本次Session中 我将介绍新工具 帮助你在Apple平台上 打造最佳游戏 首先 我将介绍 Background Assets的更新 然后 我将介绍 新的Unity插件 帮助提供出色的 应用内购买体验 最后 我将介绍 如何提升你的曝光度 在App Store和 Apple Games App上 我将从 Background Assets的更新讲起

    这是我一直在开发的 一款App 叫做The Coast 这是一款内容丰富的游戏 有多个不同关卡可以玩 除了游戏内容 该App还包含大量音频 视频 纹理 以及机器学习模型 但这些素材只在 特定时刻才真正需要 与其一开始就 下载所有素材 占用大量存储空间 Managed Background Assets 可为玩家节省时间和存储 系统会在需要时 自动下载你的素材包 为玩家提供出色的 游戏体验 对于App Store上的App Apple可为每款App 托管最多200 GB的素材 包含在开发者计划 会员资格中 Apple托管的 Background Assets可从iOS起使用 iPadOS macOS Apple tvOS 和visionOS 26 要深入了解设置 和API集成 请查看Session 《探索Apple托管的 Background Assets》WWDC25 在iOS 27中 Managed Background Assets更加强大 引入了本地化素材包 本地化素材包 大幅减少素材下载量 让玩家只需下载 所需的素材 系统会识别玩家 在"设置"中的首选语言 在"设置"中选择 并仅交付该语言的 游戏素材 如果未提供 所选语言的素材包 系统会自动回退到 最接近的语言匹配

    在The Coast中 我将英语设为主要语言 同时也提供 法语和德语 如果没有本地化素材包 系统会将所有这些素材 安装到玩家设备上 在本地化素材包之后 如果玩家将系统全局 语言偏好设置为德语 系统只会在其设备上 安装德语素材包 本地化素材包 大幅减少游戏所需存储 空间

    如果我选择英语(英国) 作为系统语言偏好 系统了解 未提供英语(英国)素材包 系统会使用用户 首选语言的基础素材包 在本例中默认为 英语(美国) 在另一种情况下 如果我选择西班牙语 The Coast未提供 西班牙语素材包 也没有类似的 区域变体可用 所以此处系统 回退到App主要语言 即英语

    要在游戏中 支持本地化素材包 请在素材包清单JSON文件 中添加语言标签

    如果你在Steam上开发游戏 可能已用仓库 管理游戏素材 现在可以更轻松地 将Steam仓库转换为素材包 在Apple平台上 与游戏一起分发 要在macOS上 使用Steam素材转换器 安装Xcode 27 并在命令行运行 xcrun ba-package convert 传入三个参数 素材包ID 以及语言ID(如适用) 以及所需的下载策略

    将你的Steam清单 构建脚本作为输入 将输出具有 指定名称的素材包清单 同一工具即将 登陆Linux和Windows

    素材包清单创建完成后 可以再次运行ba-package 生成素材包存档 使用新的清单文件 作为输入 将输出一个 素材包存档

    已打包的素材包存档 现在可以在游戏中使用了! 如果你使用Unity开发 也可以利用 Background Assets的更新 我很高兴地宣布 两款新插件 将加入Apple Unity 插件产品组合 Background Assets和StoreKit Apple Unity插件让你的游戏 能够利用最新功能 和Apple平台上的 游戏服务

    Background Assets和StoreKit插件 现已可供下载 与Apple现有插件 一起在GitHub上提供 可在本Session的 资源中找到该代码库 其中提供了构建和 安装插件的说明

    下载新的Unity插件后 可以用同一个 Python脚本构建 该脚本也用于构建 其他Apple Unity插件 两款新插件都提供 基于C#的Unity API 作为底层原生 框架的桥梁

    要构建 打包和测试插件 需要Xcode 27 Python 3 以及Unity 2022 LTS或更高版本 请查看与Apple交流Session 《规划游戏前往 Apple平台的路线》 了解更多关于设置和 配置项目的信息 以及Apple的其他 Unity插件 关于开发游戏的最佳实践 请查看《插件联动:将Apple 框架添加到Unity游戏项目》 WWDC22

    插件安装到项目后 在Unity编辑器中 打开你的游戏

    在项目中采用StoreKit 可以覆盖全球玩家 跨越所有Apple平台 并提供应用内购买 通过App Store安全可信的 商业平台

    C#版StoreKit API 提供常见流程的访问 例如获取和展示 你的应用内购买产品 通过Product API 还可以在游戏中 发起产品购买 使用Purchase API 显示系统支付页面 购买后 使用PurchaseResult 确认购买成功 以及交易IsVerified 然后将购买的内容 交付给玩家 并调用Finish() 完成交易

    在游戏的整个生命周期中 通过Transaction.Updates序列 监听新交易 交易通过此序列发出 每当系统创建 或更新交易时 这些交易发生在 App外部或其他设备上 这里有一个 OnUpdate处理器 在App启动时被调用 位于交易更新监听器内 对于消耗型商品 我首先 检查交易未被撤销 然后向客户 授予访问权限 对于非消耗型商品和订阅 currentEntitlements是权益来源 了解客户有权获得的内容 它已过滤退款 撤销和过期状态 用于非消耗型商品 和订阅 一旦确认交易已验证 即可向客户授予访问权限 最后 对已验证交易 调用Finish()

    当玩家购买内容时 可使用Background Assets插件 确保素材包 在本地可用 然后开始向玩家 提供内容 如果需要下载 可以监控下载进度 并更新游戏界面 通过迭代状态更新 由DownloadStatusUpdatesAsync 方法返回

    用新插件配置游戏后 将项目导出到Xcode 并利用强大的 测试功能 包括Xcode中的StoreKit Testing 和Background Assets模拟服务器 要在Xcode中设置 StoreKit Testing 创建StoreKit配置文件 并添加测试产品 然后编辑目标的方案 选择"运行" 在下拉菜单中选择 StoreKit配置文件 在这里还可以 选择文件夹 存放打包素材包 供模拟服务器发送给游戏

    现在可以构建并运行了! 在Xcode 27中 运行项目时 Background Assets模拟服务器 会自动启动 并附加到调试会话 向游戏提供素材 Sandbox测试也可用 帮助测试用户体验 以及你在App Store Connect中 设置的产品 当你准备好向App Store 提交游戏时 可以在产品页面标题 和搜索结果中添加新视觉元素 让你的游戏脱颖而出 你添加到App Store 搜索结果的图片和视频 也会出现在 Apple Games App中 提供更多方式来 直观地展示你的游戏 请查看WWDC26的 《提升你在App Store的曝光度》 了解更多关于 配置这些素材的信息

    最后 当你的游戏发布 玩家购买新内容时 他们将使用iOS 27中 重新设计的系统支付页面 它在横屏模式下效果很好 让玩家可以解锁内容 并继续游戏 在结束之前 让我们回顾下一步 来改善你的开发工作流程 并为玩家创造 更好的游戏体验

    进一步减少App大小 高效地向玩家 交付内容 在App Store Connect中 上传素材包的本地化版本 将原生Managed Background Assets的强大功能 和StoreKit API 带入你的Unity游戏 安装新的 Apple Unity插件 更新游戏完成后 规划如何突出你的特性 在App Store和 Apple Games App中 无论是从零开始 还是在多年工作基础上构建 这些新功能将帮助你 覆盖Apple平台的全球玩家 在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.

Developer Footer

  • 视频
  • WWDC26
  • 通过 StoreKit 和后台资源解锁游戏内内容
  • 打开菜单 关闭菜单
    • iOS
    • iPadOS
    • macOS
    • Apple tvOS
    • visionOS
    • watchOS
    打开菜单 关闭菜单
    • Swift
    • SwiftUI
    • Swift Playground
    • TestFlight
    • Xcode
    • Xcode Cloud
    • SF Symbols
    打开菜单 关闭菜单
    • 辅助功能
    • 配件
    • Apple 智能
    • App 扩展
    • App Store
    • 音频与视频 (英文)
    • 增强现实
    • 设计
    • 分发
    • 教育
    • 字体 (英文)
    • 游戏
    • 健康与健身
    • App 内购买项目
    • 本地化
    • 地图与位置
    • 机器学习与 AI
    • 开源资源 (英文)
    • 安全性
    • Safari 浏览器与网页 (英文)
    打开菜单 关闭菜单
    • 完整文档 (英文)
    • 部分主题文档 (简体中文)
    • 教程
    • 下载
    • 论坛 (英文)
    • 视频
    打开菜单 关闭菜单
    • 支持文档
    • 联系我们
    • 错误报告
    • 系统状态 (英文)
    打开菜单 关闭菜单
    • Apple 开发者
    • App Store Connect
    • 证书、标识符和描述文件 (英文)
    • 反馈助理
    打开菜单 关闭菜单
    • Apple Developer Program
    • Apple Developer Enterprise Program
    • App Store Small Business Program
    • MFi Program (英文)
    • Mini Apps Partner Program
    • News Partner Program (英文)
    • Video Partner Program (英文)
    • 安全赏金计划 (英文)
    • Security Research Device Program (英文)
    打开菜单 关闭菜单
    • 与 Apple 会面交流
    • Apple Developer Center
    • App Store 大奖 (英文)
    • Apple 设计大奖
    • Apple Developer Academies (英文)
    • WWDC
    阅读最近新闻。
    获取 Apple Developer App。
    版权所有 © 2026 Apple Inc. 保留所有权利。
    使用条款 隐私政策 协议和准则