hz-unity-meta-core-sdk
安装方式
先用 Prompt 核对来源与依赖。也可下载安装包。
用 AI 助手安装
复制提示词,让助手先核对固定版本和依赖。
查看 Prompt收起 Prompt
先检查当前 Agent 是否已安装 SkillPI Skill Finder。如果尚未安装,请按官方仓库的说明安装并启用:https://github.com/Findskills/skillpi。然后使用 Skill Finder 打开此 SkillPI 详情页并定位 "hz-unity-meta-core-sdk":https://skillpi.com/zh/skills/deepskill-0d9e2492bff1b6829ab7c88953f5ad9402822f659863b76cdc171d55e58d21d3。安装前核对上游来源和版本:https://github.com/meta-quest/agentic-tools。来源不一致时停止并说明差异。核对通过后,用 Skill Finder 安装目标 Skill,并报告安装路径和来源版本。
来源与配置
github.com
配置方式待核实
请查看原始来源中的适用工具、依赖和权限要求。
安装实测待补充
Meta XR Core SDK(com.meta.xr.sdk.core)用于 Unity XR 开发。适用于设置 VR/MR 项目、配置 OVRManager、添加 OVRCameraRig、启用透视模式、手部追踪、空间锚点、无边界模式、控制器输入、Scene API 或任何 Meta Quest XR 功能。涵盖 OVRProjectSetup、AndroidManifest 生成以及针对 Meta Quest 头显的项目配置。
介绍来源: third_party · meta-quest · 0.0.1 参考来源
SkillPi 解读
- 能完成的任务
- 翻译待完成,请参阅来源文档。
- 输入和输出
- 翻译待完成,请参阅来源文档。
- 软件、账号及付费要求
- 翻译待完成,请参阅来源文档。
- 实测状态
- 未测试
文件浏览
Frontmatter
name: hz-unity-meta-core-sdk
license: Apache-2.0
description: Meta XR Core SDK (com.meta.xr.sdk.core) for Unity XR development. Use when setting up VR/MR projects, configuring OVRManager, adding OVRCameraRig, enabling passthrough, hand tracking, spatial anchors, boundaryless mode, controller input, Scene API, or any Meta VR feature. Covers OVRProjectSetup, AndroidManifest generation, and project configuration for Meta VR devices, driven against a live Editor with unity-cli.Meta XR Core SDK (com.meta.xr.sdk.core)
The Meta XR Core SDK is the foundational Unity package for developing VR and MR applications targeting Meta VR devices. It provides the core XR rig, device management, input handling, and access to platform features like passthrough, hand tracking, spatial anchors, and scene understanding.
Package: com.meta.xr.sdk.core
Running SDK code — drive a live Editor with unity-cli
Everything here is Editor-only C#. Run it against an open Editor instead of hand-editing scene, manifest, or settings files. Connecting, --project-path, and Safe Mode recovery are in the unity-cli skill.
unity status --format json # look for state "ready"
unity command run_script --project-path <proj> --file AgentScripts/Setup.cs --entry Setup.Run --format json
Prefer run_script over eval — put the .cs outside Assets/ (path resolves against the project root) so writing it triggers no import or domain reload, and shell quoting can't mangle C# literals.
SDK-specific gotchas:
- No type-discovery reflection needed.
run_scriptreferences every loaded assembly, soOVRProjectSetup,OVRManifestPreprocessoretc. compile directly;using System.Reflection;andBindingFlagswork for the internal bits (_principalRegistry,GetTasks). - Pass
silentMode: trueto anything that may open anEditorUtility.DisplayDialog— a modal blocks the request until it times out. - Async work lands after the script returns (
FixAllAsync,Client.Add) — verify in a separate follow-uprun_script; neverTask.Wait()on the main thread. - Scene edits:
MarkSceneDirty+SaveScene(+AssetDatabase.SaveAssets()), then read the value back. - Driving Unity MCP instead of the CLI? Its constraints break the above: references/unity-mcp-fallback.md.
Finding the SDK Source
The package com.meta.xr.sdk.core may be located in different places depending on the project setup:
Library/PackageCache/com.meta.xr.sdk.core@<hash>/(cached from registry)Packages/com.meta.xr.sdk.core/(local package reference)- A custom on-disk path (embedded or local folder)
Before searching for SDK source, first locate the package root by searching for a known file by filename pattern:
**/com.meta.xr.sdk.core*/Scripts/OVRManager.cs
Then use the resolved parent path for all subsequent search operations.
CRITICAL: After Any OVRProjectConfig or OVRManager Feature Change
Any time you modify OVRProjectConfig or OVRManager feature settings (hand tracking, passthrough, boundaryless, target devices, etc.), you MUST call GenerateOrUpdateAndroidManifest() and verify the result. See references/android-manifest.md for the full workflow.
Quick Reference
| Component | Purpose |
|---|---|
| OVRCameraRig | Primary XR rig prefab replacing Unity's Main Camera |
| OVRManager | Singleton managing device state, features, and configuration |
| OVRInput | Unified API for controller input and tracking |
| OVROverlay | Compositor layers for sharper text, UI, and video |
| OVRPassthroughLayer | Enables passthrough visualization |
| OVRSpatialAnchor | World-locked spatial anchors |
| OVRBoundary | Guardian boundary system access |
| OVRProjectSetup | Project Setup Tool for configuration tasks |
OVRCameraRig: The Primary XR Rig
The OVRCameraRig prefab is the primary GameObject to add to create a VR/MR scene. It replaces Unity's conventional Main Camera and provides:
- Stereo rendering for left/right eyes
- Head and positional tracking via the TrackingSpace hierarchy
- Anchors for eyes (CenterEyeAnchor, LeftEyeAnchor, RightEyeAnchor)
- Anchors for hands/controllers (LeftHandAnchor, RightHandAnchor)
Hierarchy Structure
The OVRCameraRig hierarchy includes eye anchors, hand/controller anchors, and multimodal anchors. To see the current structure, inspect the OVRCameraRig prefab or instantiate it in a scene and examine the TrackingSpace children.
Adding OVRCameraRig to a Scene
When working with a scene that needs XR support:
- Check if OVRCameraRig exists in the current scene
- If NOT found, the agent should:
- Option A: Ask the user which scene contains the OVRCameraRig (it is part of the OVRCameraRig prefab instance)
- Option B: Open a scene where the agent knows the OVRCameraRig exists
- Option C: Ask the user if they want to add the OVRCameraRig prefab to the current scene
- When adding OVRCameraRig, follow the setup steps in references/ovr-camera-rig.md.
OVRManager: Feature Configuration
OVRManager (OVRManager.cs) is the main interface to VR hardware. It is a singleton attached to the OVRCameraRig prefab that exposes the Meta XR SDK to Unity. It controls:
- Target Devices - Which Meta VR devices to target
- Performance & Quality - MSAA, adaptive resolution, dynamic resolution
- Tracking - Tracking origin type (Eye Level, Floor Level, Stage, Stationary)
- Display - Color gamut settings
- Quest Features - Hand tracking, passthrough, keyboard, focus awareness, security, experimental features
- Mixed Reality Capture - Real-world compositing
Analyzing OVRManager for Features
To understand what features are available and how they're configured, analyze the OVRManager component on the OVRCameraRig in the scene. The OVRManager Inspector exposes all configurable XR features grouped into sections.
For the full settings reference (tracking origin, passthrough, boundary, hand tracking on OVRProjectConfig, etc.), see references/ovr-manager.md.
CRITICAL: Changing Serialized Fields — Use SerializedObject, Not Reflection
To change a serialized field on any component, edit it via SerializedObject + FindProperty(name) + ApplyModifiedProperties() — never reflection (FieldInfo/PropertyInfo.SetValue). Reflection mutates the in-memory object but bypasses serialization: for a component on a prefab instance (e.g. OVRManager on OVRCameraRig), the change isn't recorded as a prefab override and is silently dropped on save (SaveScene returns true, but the field reverts to the prefab default).
- Get the component as
UnityEngine.Object(FindObjectOfType/GetComponent);SerializedObject/FindPropertywork by name, so no asmref is needed. - The serialized name is the
[SerializeField]backing field (often_camelCase), not the public property. IfFindPropertyreturns null, discover names by iteratingso.GetIterator()(Next(true)→ logpropertyPath). - After
ApplyModifiedProperties(), callMarkSceneDirty→SaveScene→SaveAssets, then read the field back to confirm it persisted.
// component obtained as UnityEngine.Object (e.g. FindObjectOfType(type) as Object)
var so = new SerializedObject(component);
so.FindProperty("_SERIALIZED_FIELD_NAME").boolValue = true; // typed accessor: boolValue/floatValue/intValue/...
so.ApplyModifiedProperties(); // records the prefab-instance override + marks dirty
var scene = EditorSceneManager.GetActiveScene();
EditorSceneManager.MarkSceneDirty(scene);
EditorSceneManager.SaveScene(scene);
AssetDatabase.SaveAssets();
// verify before declaring success
var check = new SerializedObject(component).FindProperty("_SERIALIZED_FIELD_NAME").boolValue;
OVRProjectSetup (UPST): Listing and Fixing Project Issues
The Unity Project Setup Tool (UPST) (OVRProjectSetup) is a Unity Editor extension that validates project configuration for Meta VR. It maintains a registry of Configuration Tasks — each task checks a specific setting and reports whether it is satisfied or outstanding.
Primary use: list all outstanding issues for the current platform, then fix them.
- List issues — Query all tasks, filter by platform/validity, and report those where
IsDoneis false. Each issue has a level (Required, Recommended, Optional), a group (Compatibility, Rendering, Features, etc.), and a fix type (Auto-fix or Manual). - Fix issues — Use
FixAllAsync(BuildTargetGroup)to auto-fix all fixable issues, or invoke individualFixActiondelegates directly.
Drive UPST programmatically against a live Editor with unity-cli (see references/project-setup-tool.md for the full API, task registry access, property reading, and fix invocation patterns).
Access via UI: Meta > Tools > Project Setup Tool.
After UPST is green, prove it on hardware: build an APK, metavr app install <apk>, and confirm the expected features initialized in a metavr log --tag Unity snapshot.
CRITICAL: AndroidManifest Update
NEVER directly edit AndroidManifest.xml for features managed by OVRProjectConfig. See references/android-manifest.md for the full manifest update workflow and rules.
Core Features
Passthrough (Mixed Reality)
Passthrough provides real-time visualization of the physical world inside the headset, enabling mixed reality experiences. See references/passthrough.md for setup steps and configuration.
Hand Tracking
Hand tracking enables natural hand interaction without controllers. See references/hand-tracking.md for setup and configuration.
Spatial Anchors
Spatial anchors anchor virtual content to real-world locations that persist across sessions.
For spatial anchors details, see references/spatial-anchors.md.
Scene API
Scene provides access to the user's physical environment model (walls, floor, furniture) for scene-aware MR experiences.
For Scene API details, see references/scene-api.md.
Boundaryless Mode
Boundaryless mode disables the Guardian boundary for MR experiences where the physical world is visible.
For boundaryless setup, see references/boundaryless.md.
Compositor Layers (OVROverlay)
OVROverlay renders textures directly via the VR compositor, bypassing eye buffer resampling for sharper text, UI, and video. Supports up to 15 overlay layers per scene with quad, cylinder, cubemap, equirect, and fisheye shapes.
For compositor layer details, see references/ovr-overlay.md.
Controller Input (OVRInput)
OVRInput provides unified access to controller buttons, triggers, thumbsticks, and tracking.
For controller input details, see references/controller-input.md.
Project Setup Workflow
For the full project setup workflow (install SDK, set build platform, configure XR provider, add OVRCameraRig, configure OVRManager, generate AndroidManifest), see references/project-setup-workflow.md.
Documentation Links
All documentation references point to the official Meta developer docs at developers.meta.com:
- Meta XR Core SDK Overview
- OVRCameraRig Configuration
- Project Setup Tool
- Android Manifest Generation
- Passthrough API
- Hand Tracking Overview
- Spatial Anchors Overview
- Scene Overview
- Compositor Layers (OVROverlay)
- Controller Input
- Project Configuration
Using metavr Tools for Latest Docs
If the metavr MCP server is available, use the mcp__metavr__vr_docs_search and mcp__metavr__vr_docs_get_page tools to verify current API details, as Meta SDK documentation updates frequently. Use mcp__metavr__vr_api_search with engine='unity' to look up exact method signatures for OVRManager, OVRCameraRig, OVRInput, and other classes.
Related skills
unity-cli— drive a live Editor, install editors, build/testhz-unity-meta-interaction-sdk— interaction layer (grab, poke, teleport, interaction rig)hz-xr-simulator-install-and-configure/hz-vr-debug— run and debug beyond Play mode
版本历史
-
v1.8.0
GitHub ↗
原版更新说明
**Full Changelog**: https://github.com/meta-quest/agentic-tools/compare/v1.2.3...v1.8.0
-
v1.2.3
GitHub ↗
原版更新说明
**Full Changelog**: https://github.com/meta-quest/agentic-tools/compare/v1.2.1...v1.2.3
-
v1.2.1
GitHub ↗
原版更新说明
**Full Changelog**: https://github.com/meta-quest/agentic-tools/commits/v1.2.1
当前收录版本
0.0.1
质量评测
满分100 · 来自 SkillPi LAB 实验室的评测报告。
亮点
- Meta XR Core SDK是Unity VR/MR开发的核心工具,直接解决用户在Meta Quest设备上开发VR/MR应用的核心任务痛点
- 涵盖项目设置、XR rig配置、功能启用等关键流程,具有明确的实用价值
- 提供了完整的项目配置工作流和详细的API参考
亮点
- 触发词精准完整,明确列出了适用场景如设置VR/MR项目、配置OVRManager、添加OVRCameraRig等
- 覆盖多种变体,边界清晰,用户能准确理解Skill的适用范围
待提升项
-
文档长度优化 原报告严重程度:轻微
文档内容较为详尽,但部分章节可以更精简以提高可读性
改进建议:考虑将部分详细说明移至参考文档,保持主文档的简洁性
亮点
- 结构清晰,有Phase/步骤划分,包含端到端示例
- frontmatter完整,提供了清晰的导航和参考链接
亮点
- 工具来源明确,参数正确,覆盖主要异常,有确认机制
- 提供了详细的错误处理建议和最佳实践
- 强调了关键操作的验证步骤,如AndroidManifest生成后的验证
取前四项原始分值的算术平均,四舍五入取整。可通过收录报告核对各项评分与说明,运行记录需单独查证。
正文静态检测
100 / 100 · skillpi-20261123-no-r3-v1
正文未命中当前规则。
分数仅反映正文中的规则命中,供使用前参考。附件与运行行为不在此评分范围内。
权限与使用前检查
根据当前主文档自动整理,命中内容可能是示例或防护说明;不是实际权限声明,也未覆盖附件、外部依赖或运行行为。
未从主文档识别到上述常见操作,不能据此判断无需权限或没有风险。
文档引用的域名或地址
这些地址可能用于文档链接或示例,不是已批准的联网清单。使用前核对实际目的地及发送的数据。
- developers.meta.com
安全评级与访问范围
safe · 静态证据核验,不代表运行安全保证。
翻译待完成,请参阅来源文档。
使用前请由宿主核对并授权实际文件读写、外部服务和联网目的地;本站的核验不会授予任何运行权限。
用户讨论
还没有已核实的点评。