hz-unity-platform-sdk
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseHorizon Platform SDK - Unity/C# Integration Guide
Horizon Platform SDK - Unity/C# 集成指南
When to Use
使用场景
Use this skill when a developer:
- Wants to integrate any Horizon Platform SDK feature in a Unity Meta Quest application
- Asks about setup, initialization, or dependencies for the Unity SDK package ()
com.meta.xr.sdk.platform - Needs help with a specific public platform API (achievements, IAP, users, etc.) in C#
- Is troubleshooting errors or status codes from any SDK package in Unity
- Asks about ,
Core.AsyncInitialize, or platform message handlingOculus.Platform
For Android/Kotlin apps, use the skill instead.
hz-platform-sdk当开发者遇到以下情况时,可使用本技能:
- 希望在Unity开发的Meta Quest应用中集成Horizon Platform SDK的任意功能
- 咨询Unity SDK包()的设置、初始化或依赖配置问题
com.meta.xr.sdk.platform - 需要在C#中使用特定的公开平台API(成就系统、IAP、用户系统等)的相关帮助
- 排查Unity中任意SDK包产生的错误或状态码问题
- 咨询、
Core.AsyncInitialize或平台消息处理相关问题Oculus.Platform
对于Android/Kotlin应用,请改用技能。
hz-platform-sdkQuick Start
快速开始
- Setup guide: https://developers.meta.com/horizon/documentation/unity/ps-platform-intro/
- UPM Package: via Unity Package Manager
com.meta.xr.sdk.platform - Namespace: (backward compatible with legacy LibOVRPlatform SDK)
Oculus.Platform
- 设置指南:https://developers.meta.com/horizon/documentation/unity/ps-platform-intro/
- UPM包:通过Unity Package Manager获取
com.meta.xr.sdk.platform - 命名空间:(向后兼容旧版LibOVRPlatform SDK)
Oculus.Platform
Available APIs
可用API
| Feature | Reference | Description |
|---|---|---|
| Abuse Report | | Listen for system Report button events, respond with in-app flow |
| Achievements | | Unlock, track progress, and query simple/count/bitfield achievements |
| Application | | Get app version, launch other apps, manage self-update downloads |
| Application Lifecycle | | Detect launch type, handle deeplinks and invites, log results |
| Asset File | | List, download, cancel, and delete downloadable asset files (DLC) |
| Challenges | | Time-bound score competitions on top of leaderboards |
| Consent | | Check and launch user consent flows with version bumps |
| Device Application Integrity | | Verify device and app integrity via JWT attestation |
| Entitlements | | Mandatory anti-piracy check required for all Store apps |
| Group Presence | | Set/clear presence, manage sessions, send invites, handle join intents |
| In-App Purchases (IAP) | | Retrieve products, purchase history, checkout flow, consume purchases |
| Language Pack | | Get/set language packs with auto-download |
| Leaderboards | | Retrieve leaderboard info, fetch/write entries with filtering |
| Notifications | | Send device notifications with toast, feed persistence, and action buttons |
| Rate and Review | | Check eligibility and launch the system rating/review UI |
| Rich Presence | | Set/clear rich presence (deprecated; prefer group-presence) |
| User Age Category | | Query user age group and report age categories for compliance |
| Users | | Retrieve user profiles, friends, access tokens, identity verification |
| 功能 | 参考标识 | 描述 |
|---|---|---|
| 举报功能 | | 监听系统举报按钮事件,响应用内举报流程 |
| 成就系统 | | 解锁、跟踪进度并查询简单型/计数型/位字段型成就 |
| 应用管理 | | 获取应用版本、启动其他应用、管理自动更新下载 |
| 应用生命周期 | | 检测启动类型、处理深度链接与邀请、记录结果 |
| 资源文件 | | 列出、下载、取消及删除可下载资源文件(DLC) |
| 挑战系统 | | 基于排行榜的限时分数竞赛功能 |
| 用户同意管理 | | 检查并启动用户同意流程,支持版本更新 |
| 设备应用完整性 | | 通过JWT验证设备与应用完整性 |
| 授权验证 | | 所有商店应用必需的反盗版检查机制 |
| 群组状态 | | 设置/清除状态、管理会话、发送邀请、处理加入请求 |
| 应用内购买(IAP) | | 获取产品信息、购买历史、结账流程、消费已购项目 |
| 语言包 | | 获取/设置语言包,支持自动下载 |
| 排行榜 | | 获取排行榜信息、筛选读写榜单条目 |
| 通知功能 | | 发送设备通知,支持弹窗、信息流持久化及操作按钮 |
| 评分与评价 | | 检查资格并启动系统评分/评价界面 |
| 富状态显示 | | 设置/清除富状态(已弃用;推荐使用group-presence) |
| 用户年龄分类 | | 查询用户年龄组并上报年龄分类以符合合规要求 |
| 用户系统 | | 获取用户资料、好友列表、访问令牌、身份验证信息 |
How to Use
使用步骤
- First, read for shared setup instructions, initialization code, Editor testing, and common patterns that apply to all APIs.
references/common-setup.md - Then, read the specific reference file for the API you need (e.g., for in-app purchases).
references/iap.md
Each reference file contains only the package-specific content: API operations, data types, examples, and package-specific notes. The common setup, initialization patterns, and coding conventions are centralized in to avoid duplication.
common-setup.md- 首先,阅读获取通用设置说明、初始化代码、编辑器测试方法及适用于所有API的通用模式。
references/common-setup.md - 然后,阅读对应API的具体参考文件(例如,如需应用内购买功能,请阅读)。
references/iap.md
每个参考文件仅包含该包的专属内容:API操作、数据类型、示例及包专属注意事项。通用设置、初始化模式及编码规范集中在中,避免内容重复。
common-setup.md