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

unity-performanceUnity 性能

Agent Skill

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

总安装

451

周安装

19

GitHub Stars

33

下载量

158
CodexClaudeCursorGemini CLI

安装说明

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

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

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

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

命令行安装

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

skills.shnpx skills
npx skills add https://github.com/josiahsiegel/claude-plugin-marketplace --skill unity-performance

简介

用于查找、检索和筛选相关信息。

  • 适合在 Codex、Claude、Cursor、Gemini CLI 中根据关键词、任务场景或来源线索快速定位候选结果。
  • 通过 npx skills add 命令从指定仓库安装并使用。
  • 安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。
  • unity-performance 属于研究检索类 Skill,可作为该场景下的辅助能力补充。

SKILL.md

Unity Performance Optimization

Overview

Systematic approach to profiling and optimizing Unity games. Covers profiling tools, CPU/GPU optimization, memory management, rendering optimization, and platform-specific considerations.

Profiling Tools

ToolWhat It ShowsWhen to Use
Unity ProfilerCPU, GPU, memory, audio, physics per frameFirst stop for any perf issue
Frame DebuggerDraw call breakdown, shader/material stateRendering bottlenecks
Memory ProfilerHeap snapshots, texture/mesh memoryMemory leaks, bloat
Profile AnalyzerCompare captures, statistical analysisBefore/after optimization
Physics DebuggerCollider visualization, contact pointsPhysics performance

Profiler Workflow

  1. Build with Development Build + Autoconnect Profiler enabled
  2. Profile on target device (not in Editor -- Editor overhead distorts results)
  3. Identify the bottleneck category: CPU-bound, GPU-bound, or memory pressure
  4. Drill into the specific system causing the issue
  5. Optimize, re-profile, and compare

Reading the Profiler

If frame time > 16.6ms (60 FPS target):
  CPU timeline > GPU timeline -> CPU-bound
  GPU timeline > CPU timeline -> GPU-bound
  GC.Alloc column shows per-frame allocations -> GC pressure

Look for spikes (single bad frames) vs. sustained high times (baseline too heavy).

CPU Optimization

Reduce Per-Frame Allocations (GC)

Anti-PatternFix
string + string in UpdateUse StringBuilder or cache
new List<T>() every frameAllocate once, Clear() and reuse
LINQ in hot pathsReplace with manual loops
GetComponent<T>() per frameCache in Awake/Start
GameObject.Find() per frameCache reference or use events
foreach on non-generic collectionsUse for loop or generic collections
SendMessage() / BroadcastMessage()Use direct calls, events, or interfaces
Boxing value typesUse generic collections, avoid object casts

Object Pooling

public class ObjectPool<T> where T : Component
{
    readonly Queue<T> _pool = new();
    readonly T _prefab;
    readonly Transform _parent;

    public ObjectPool(T prefab, int preWarm, Transform parent = null)
    {
        _prefab = prefab;
        _parent = parent;
        for (int i = 0; i < preWarm; i++)
            _pool.Enqueue(CreateInstance());
    }

    public T Get(Vector3 position, Quaternion rotation)
    {
        var obj = _pool.Count > 0 ? _pool.Dequeue() : CreateInstance();
        obj.transform.SetPositionAndRotation(position, rotation);
        obj.gameObject.SetActive(true);
        return obj;
    }

    public void Return(T obj)
    {
        obj.gameObject.SetActive(false);
        _pool.Enqueue(obj);
    }

    T CreateInstance()
    {
        var obj = Object.Instantiate(_prefab, _parent);
        obj.gameObject.SetActive(false);
        return obj;
    }
}

Pool bullets, particles, enemies, UI elements -- anything instantiated/destroyed frequently. Unity 2021+ also has UnityEngine.Pool.ObjectPool<T> built-in.

Update Optimization

TechniqueDescription
Stagger updatesDon't update all AI every frame; use tick groups
Distance-based LODReduce update frequency for distant objects
Event-drivenReplace polling with events where possible
Disable unused scriptsenabled = false on off-screen components
Use InvokeRepeatingFor periodic checks (cheaper than coroutine yielding)

GPU / Rendering Optimization

Draw Call Reduction

TechniqueHowSavings
Static BatchingMark non-moving objects as StaticCombines meshes at build time
Dynamic BatchingAutomatic for small meshes (<300 verts)URP/Built-in only
GPU InstancingEnable on materials for repeated objectsTrees, grass, rocks
SRP BatcherEnabled by default in URP/HDRPReduces SetPass calls
Texture AtlasingCombine textures into atlasFewer material switches
Mesh CombiningCombineMeshes() at runtimeCustom batching

LOD (Level of Detail)

LOD Group Setup:
  LOD 0 (0-30%):  Full-detail mesh (5000 tris)
  LOD 1 (30-60%): Medium mesh (2000 tris)
  LOD 2 (60-90%): Low mesh (500 tris)
  Culled (90%+):  Not rendered

Use LOD for meshes, but also reduce script complexity, particle counts, and physics at distance.

Occlusion Culling

Bake occlusion data for indoor/complex scenes. Mark large static occluders (walls, floors). Configure cell size based on scene scale. Use the Occlusion Culling window to visualize and test.

Shader Optimization

IssueSolution
Complex fragment shadersReduce texture samples, simplify math
OverdrawMinimize transparent objects, use opaque when possible
Too many variantsStrip unused shader variants in build settings
Expensive post-processingDisable effects on mobile, use cheaper alternatives

Memory Management

Common Memory Issues

IssueSymptomFix
Texture bloatHigh memory, long loadsCompress textures, reduce max size per platform
Unloaded scenes holding refsMemory climbs over timeUse Resources.UnloadUnusedAssets() after scene transitions
Addressables not releasedBundles stay in memoryCall Addressables.Release(handle)
Audio clips uncompressedHuge memory footprintUse compressed in memory for music, decompress on load for SFX
Mesh read/write enabledDouble memory per meshDisable Read/Write if not needed at runtime

Texture Compression Per Platform

PlatformFormatNotes
PC/ConsoleBC7 (DXT)Best quality/size ratio
AndroidASTC 6x6Universal, scalable quality
iOSASTC 6x6Same as Android
WebGLETC2 / DXTDepends on target GPU

Use "Override for [Platform]" in texture import settings. Set max texture size to the minimum needed (512 for UI icons, 1024 for props, 2048 for hero assets).

Platform-Specific Considerations

PlatformKey Constraints
MobileThermal throttling, limited memory, battery drain, fill-rate limited
WebGLNo threads (pre-Unity 6), large download size, no compute shaders
ConsoleCertification requirements, fixed hardware, memory budgets
VR/XR72-90 FPS minimum, stereo rendering cost, motion sickness from drops

Addressables and Asset Loading

Use Addressables for async asset loading to avoid load-time hitches:

// Preload during loading screen
var handle = Addressables.LoadAssetAsync<GameObject>("enemy_boss");
await handle;

// Release when done
Addressables.Release(handle);

Use Addressable groups to control bundle granularity. Mark infrequently used assets as remote/on-demand. Profile bundle memory with the Addressables Event Viewer.

Quick Optimization Checklist

  • Profile on target device, not in Editor
  • Zero per-frame GC allocations in gameplay code
  • Object pooling for all frequently spawned objects
  • Static batching enabled for non-moving objects
  • LOD groups on all 3D models visible at varying distances
  • Textures compressed per platform with appropriate max sizes
  • Disable Read/Write on meshes and textures not modified at runtime
  • Audio clips use appropriate compression settings
  • Occlusion culling baked for indoor/complex scenes
  • Shader variants stripped in build settings

Additional Resources

Reference Files

  • references/profiling-deep-dive.md -- Advanced Profiler usage, memory profiler snapshots, frame-by-frame analysis, custom profiler markers, automated performance testing, build size analysis, ECS/DOTS performance patterns

适合场景

01

用户想查找某类 Agent Skill 时

02

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

03

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

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

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

能力 4

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

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

平台分布

Codex

32.76%
按下载量换算52

Claude

31.15%
按下载量换算49

Cursor

19.3%
按下载量换算30

Gemini CLI

10.26%
按下载量换算16

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

需要联网

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

安装前确认

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

来源信息

继续浏览同类 Skills