Token导航 LogoToken导航TokenDH.com
研究检索需要联网github未标认证来源可访问许可证需确认审计通过

hz-unity-code-reviewHZ Unity 代码审查

Agent Skill

hz-unity-code-review 用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

225

周安装

9

GitHub Stars

31

下载量

73
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:hz-unity-code-review(HZ Unity 代码审查)
来源仓库:https://github.com/meta-quest/agentic-tools
仓库路径:skills/hz-unity-code-review
安装命令:
npx skills add https://github.com/meta-quest/agentic-tools --skill hz-unity-code-review
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/meta-quest/agentic-tools --skill hz-unity-code-review

简介

hz-unity-code-review 用于查找、检索和筛选相关信息,支持基于关键词的任务场景定位。

  • 适用于 Unity 项目代码审查、规范检查和问题定位相关查询。
  • 可在 Codex、Claude、Cursor、Gemini CLI 中快速获取候选结果。
  • 需确认权限范围和维护状态,避免触发联网或文件读写操作。
  • 建议结合来源仓库和原始 README 继续核验具体用法。

SKILL.md

Unity Code Review for Meta Quest

When to Use

Use this skill when reviewing Unity C# code or project settings that target Meta Quest headsets. This includes:

  • Reviewing scripts for VR performance issues
  • Checking rendering pipeline configuration and settings
  • Ensuring adherence to Quest-specific best practices
  • Identifying common VR development pitfalls
  • Validating input handling for controllers, hands, and eye tracking
  • Auditing memory usage and GC allocation patterns

Key Review Areas

1. Rendering Pipeline Configuration

Quest applications must use the Universal Render Pipeline (URP) with specific settings optimized for mobile VR. The Built-in Render Pipeline is not recommended for new Quest projects.

Critical settings to verify:

  • Single-pass multiview must be enabled (Player Settings > XR Plug-in Management > Oculus > Stereo Rendering Mode)
  • Vulkan should be the primary graphics API
  • Linear color space is required for correct lighting
  • HDR should be disabled in URP asset settings
  • Post-processing should be minimal or disabled

2. Draw Call Budgets and Batching

Quest has draw call budgets that vary by workload complexity. Every draw call has CPU overhead that directly impacts frame timing.

MetricQuest 2 / Quest ProQuest 3 / Quest 3S
Draw calls (busy simulation)80-200200-300
Draw calls (medium simulation)200-300400-600
Draw calls (light simulation)400-600700-1000
Triangles per frame750K-1M1M-2M
SetPass calls< 50< 80

Enable and verify:

  • Static batching for non-moving geometry
  • GPU instancing for repeated objects
  • SRP batcher for URP materials
  • Dynamic batching for small meshes (< 300 vertices)

3. Shader Complexity

Mobile GPUs on Quest cannot handle desktop-class shaders. Review all materials for:

  • Use of URP/Lit or URP/Simple Lit instead of Standard shader
  • Custom shaders that minimize texture samples and ALU operations
  • Avoidance of real-time shadows where possible (bake instead)
  • No screen-space effects (SSAO, SSR, screen-space shadows)

4. Memory Management

GC allocations cause frame hitches and must be eliminated from hot paths.

// BAD: Allocates every frame
void Update() {
    string label = "Score: " + score.ToString();
    var enemies = FindObjectsOfType<Enemy>();
    var filtered = enemies.Where(e => e.IsAlive).ToList();
}

// GOOD: Zero allocations in Update
private StringBuilder _sb = new StringBuilder(32);
private List<Enemy> _enemyCache = new List<Enemy>();
private Enemy[] _enemyArray;

void Start() {
    _enemyArray = FindObjectsOfType<Enemy>();
}

void Update() {
    _sb.Clear();
    _sb.Append("Score: ");
    _sb.Append(score);
}

5. Input Handling

Quest supports multiple input modalities. Code should handle:

  • Controllers: Use Unity's Input System Package for new projects (recommended); OVRInput is maintained for legacy support
  • Hand tracking: OVRHand and OVRSkeleton for hand pose data
  • Eye tracking: OVREyeGaze (Quest Pro / Quest 3, requires permission)
  • Graceful switching between controller and hand tracking modes

6. Physics Configuration

Physics simulation is expensive on mobile. Review for:

  • Physics timestep set to match target frame rate (72/90/120 Hz)
  • Simplified collision meshes (use primitives, not mesh colliders)
  • Reduced solver iterations (4-6 is usually sufficient)
  • Layer-based collision matrix to minimize pair checks
  • Rigidbody sleep thresholds configured appropriately

7. Audio Setup

Audio is often overlooked but can impact performance:

  • Compress audio clips (Vorbis for music, ADPCM for short SFX)
  • Use streaming load type for clips longer than 1 second
  • Limit simultaneous audio sources (target < 16)
  • Spatialize audio using Meta's audio SDK for 3D positioning

Quick Review Checklist

AreaTargetNotes
Draw calls80-200 (busy) to 400-600 (light)Use batching, instancing, atlasing
Triangles750K-1M/frameUse LODs, occlusion culling
Texture resolutionMax 2K, 4K sparinglyASTC compression required
ShaderURP mobile shadersNo Standard shader, no screen-space effects
Rendering modeSingle-pass multiviewMust be enabled in XR settings
FFREnabled (High or HighTop)Fixed foveated rendering reduces edge fragment cost
MSAA4x quality / 2x perfFree on tile-based GPU when configured correctly
Target frame rate72 Hz minimum90 Hz recommended, 120 Hz for smooth experiences
GC allocations0 B/frame in steady stateNo allocations in Update/LateUpdate/FixedUpdate
Audio sources< 16 simultaneousUse pooling for audio sources

What to Look For in Code

GC-Heavy Patterns

// Flag these patterns in code review:
Camera.main                          // Calls FindWithTag internally
GameObject.Find("name")             // Linear search every call
GetComponent<T>() in Update         // Cache the result
new List<T>() in Update             // Allocates on heap
string + string in Update           // Creates new string objects
foreach on non-List collections     // Enumerator allocation
LINQ queries (.Where, .Select)      // Multiple allocations
Boxing (int -> object)              // Heap allocation
delegate/lambda in hot paths        // Closure allocation

Update() Misuse

// BAD: Empty Update still has overhead
void Update() { }

// BAD: Logic that doesn't need per-frame execution
void Update() {
    SavePlayerPrefs();  // Should be event-driven
}

// GOOD: Use events, coroutines, or InvokeRepeating for non-per-frame logic
void OnScoreChanged(int newScore) {
    UpdateScoreUI(newScore);
}

Camera.main Anti-Pattern

// BAD: Camera.main uses FindWithTag internally
void Update() {
    transform.LookAt(Camera.main.transform);
}

// GOOD: Cache the reference
private Transform _cameraTransform;

void Start() {
    _cameraTransform = Camera.main.transform;
}

void Update() {
    transform.LookAt(_cameraTransform);
}

Find Calls in Hot Paths

// BAD: Expensive search every frame
void Update() {
    var player = GameObject.FindWithTag("Player");
    var rb = player.GetComponent<Rigidbody>();
}

// GOOD: Cache in Awake/Start or use dependency injection
private Rigidbody _playerRb;

void Awake() {
    _playerRb = GameObject.FindWithTag("Player").GetComponent<Rigidbody>();
}

Using hzdb for Validation

You can use the hzdb tool to validate builds and check device-side behavior. Install once with npm install -g @meta-quest/hzdb.

# Check connected Quest device
hzdb device list

# Install and run a build
hzdb app install path/to/build.apk
hzdb app launch com.company.app

# Check device logs for errors
hzdb adb logcat --tag Unity

# Monitor GPU performance
hzdb perf capture

Use device-side profiling to validate that code review findings translate to real performance improvements.

Reference Documents

For detailed guidance on specific topics, see the following reference documents:

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

34.51%
按下载量换算25

Claude

29.6%
按下载量换算22

Cursor

17.61%
按下载量换算13

Gemini CLI

10.23%
按下载量换算7

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

需要联网

该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills