unity-profiler

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese
Before calling any skill in this module: if you are about to call a skill with parameters guessed from its name or description, STOP — read this file (or fetch its schema via
GET /skills/recommend?includeSchema=true
) first. If you already have the parameter definitions from recommend/schema, you may proceed straight to dryRun.
调用本模块中的任何skill前: 如果您打算根据skill的名称或描述猜测参数来调用,请停止——先阅读本文档(或通过
GET /skills/recommend?includeSchema=true
获取其schema)。如果您已经从推荐/schema中获取了参数定义,可以直接进行dryRun。

Triggers

触发场景

  • Checking runtime performance
  • Taking a profiler snapshot
  • Inspecting memory/frame stats
  • 查看运行时性能、抓取 profiler 快照、检查内存/帧率统计
  • 检查运行时性能
  • 抓取Profiler快照
  • 查看内存/帧率统计
  • 查看运行时性能、抓取Profiler快照、检查内存/帧率统计

Profiler Skills

Profiler Skills

Get performance statistics.
获取性能统计数据。

Operating Mode

运行模式

  • Approval / Auto / Bypass: 所有 skill 直接执行。本模块全部
    ReadOnly = true, Mode = SkillMode.SemiAuto
    ,三档模式下都不需要 grant。
  • 本模块不含 Delete / PlayMode / Reload / RiskLevel=high 类 skill —— 没有
    IsForbiddenInSemi
    拦截。
  • 注:本组 skill 仅做"瞬时快照"读取,不是 Profiler 录制控制;持续采样请用 Unity Profiler 窗口。
DO NOT (common hallucinations):
  • profiler_start
    /
    profiler_stop
    do not exist → profiler skills are read-only snapshots, not recording controls
  • profiler_record
    does not exist → use Unity Profiler window for recording
  • profiler_analyze
    /
    profiler_get_fps
    do not exist → use
    profiler_get_stats
    (FPS, batches, draw calls) or
    profiler_get_memory
    (heap sizes)
Routing:
  • For scene performance hints → use
    perception
    module's
    scene_performance_hints
  • For memory info →
    debug_get_memory_info
    (debug module) or
    profiler_get_memory
    (this module)
  • For optimization suggestions → use
    optimization
    module
  • Approval / Auto / Bypass:所有skill直接执行。本模块全部标记为
    ReadOnly = true, Mode = SkillMode.SemiAuto
    ,三种模式下均无需授权(grant)。
  • 本模块不含 Delete / PlayMode / Reload / RiskLevel=high 类型的skill —— 不存在
    IsForbiddenInSemi
    拦截。
  • 注:本组skill仅用于"瞬时快照"读取,并非Profiler录制控制;如需持续采样,请使用Unity Profiler窗口。
请勿执行以下操作(常见误区):
  • profiler_start
    /
    profiler_stop
    不存在 → Profiler skill是只读快照,并非录制控制工具
  • profiler_record
    不存在 → 如需录制,请使用Unity Profiler窗口
  • profiler_analyze
    /
    profiler_get_fps
    不存在 → 请使用
    profiler_get_stats
    (获取FPS、批处理、绘制调用)或
    profiler_get_memory
    (获取堆内存大小)
路由指引:
  • 如需场景性能提示 → 使用
    perception
    模块的
    scene_performance_hints
  • 如需内存信息 →
    debug_get_memory_info
    (debug模块)或
    profiler_get_memory
    (本模块)
  • 如需优化建议 → 使用
    optimization
    模块

Skills

Skills

profiler_get_stats

profiler_get_stats

Get performance statistics (FPS, Memory, Batches). Parameters: None.
Returns:
json
{
  "fps": 60.0,
  "triangles": 1500,
  "batches": 12,
  "memory": { "totalAllocatedMB": 256.5, ... }
}
获取性能统计数据(FPS、内存、批处理)。 参数: 无。
返回值:
json
{
  "fps": 60.0,
  "triangles": 1500,
  "batches": 12,
  "memory": { "totalAllocatedMB": 256.5, ... }
}

profiler_get_memory

profiler_get_memory

Get memory usage overview (total allocated, reserved, mono heap). Parameters: None.
Returns:
{ success, totalAllocatedMB, totalReservedMB, unusedReservedMB, monoHeapMB, monoUsedMB }
获取内存使用概览(总分配内存、预留内存、Mono堆内存)。 参数: 无。
返回值:
{ success, totalAllocatedMB, totalReservedMB, unusedReservedMB, monoHeapMB, monoUsedMB }

profiler_get_runtime_memory

profiler_get_runtime_memory

Get top N objects by runtime memory usage in the scene.
ParameterTypeRequiredDefaultDescription
limitintNo20Maximum number of objects to return
Returns:
{ success, totalTrackedMB, showing, objects: [{ name, type, sizeKB }] }
获取场景中运行时内存占用Top N的对象。
参数类型是否必填默认值描述
limitint20返回的最大对象数量
返回值:
{ success, totalTrackedMB, showing, objects: [{ name, type, sizeKB }] }

profiler_get_texture_memory

profiler_get_texture_memory

Get memory usage of all loaded textures.
ParameterTypeRequiredDefaultDescription
limitintNo50Maximum number of textures to return
Returns:
{ success, totalCount, totalMB, topTextures: [{ name, type, sizeKB, width, height }] }
获取所有已加载纹理的内存使用情况。
参数类型是否必填默认值描述
limitint50返回的最大纹理数量
返回值:
{ success, totalCount, totalMB, topTextures: [{ name, type, sizeKB, width, height }] }

profiler_get_mesh_memory

profiler_get_mesh_memory

Get memory usage of all loaded meshes.
ParameterTypeRequiredDefaultDescription
limitintNo50Maximum number of meshes to return
Returns:
{ success, totalCount, totalMB, topMeshes: [{ name, sizeKB, vertices, triangles }] }
获取所有已加载网格的内存使用情况。
参数类型是否必填默认值描述
limitint50返回的最大网格数量
返回值:
{ success, totalCount, totalMB, topMeshes: [{ name, sizeKB, vertices, triangles }] }

profiler_get_material_memory

profiler_get_material_memory

Get memory usage of all loaded materials.
ParameterTypeRequiredDefaultDescription
limitintNo50Maximum number of materials to return
Returns:
{ success, totalCount, totalMB, topMaterials: [{ name, shader, sizeKB }] }
获取所有已加载材质的内存使用情况。
参数类型是否必填默认值描述
limitint50返回的最大材质数量
返回值:
{ success, totalCount, totalMB, topMaterials: [{ name, shader, sizeKB }] }

profiler_get_audio_memory

profiler_get_audio_memory

Get memory usage of all loaded AudioClips.
ParameterTypeRequiredDefaultDescription
limitintNo50Maximum number of clips to return
Returns:
{ success, totalCount, totalMB, topClips: [{ name, sizeKB, length, channels, frequency }] }
获取所有已加载AudioClip的内存使用情况。
参数类型是否必填默认值描述
limitint50返回的最大音频片段数量
返回值:
{ success, totalCount, totalMB, topClips: [{ name, sizeKB, length, channels, frequency }] }

profiler_get_object_count

profiler_get_object_count

Count all loaded objects grouped by type.
ParameterTypeRequiredDefaultDescription
topNintNo20Number of top types to return
Returns:
{ success, totalObjects, topTypes: [{ type, count }] }
按类型统计所有已加载对象的数量。
参数类型是否必填默认值描述
topNint20返回的Top类型数量
返回值:
{ success, totalObjects, topTypes: [{ type, count }] }

profiler_get_rendering_stats

profiler_get_rendering_stats

Get rendering statistics (batches, triangles, vertices, etc.). Parameters: None.
Returns:
{ success, frameTime, renderTime, triangles, vertices, batches, setPassCalls, drawCalls, dynamicBatchedDrawCalls, staticBatchedDrawCalls, instancedBatchedDrawCalls, shadowCasters }
获取渲染统计数据(批处理、三角形、顶点等)。 参数: 无。
返回值:
{ success, frameTime, renderTime, triangles, vertices, batches, setPassCalls, drawCalls, dynamicBatchedDrawCalls, staticBatchedDrawCalls, instancedBatchedDrawCalls, shadowCasters }

profiler_get_asset_bundle_stats

profiler_get_asset_bundle_stats

Get information about all loaded AssetBundles. Parameters: None.
Returns:
{ success, count, bundles: [{ name, isStreamedSceneAssetBundle }] }
获取所有已加载AssetBundle的信息。 参数: 无。
返回值:
{ success, count, bundles: [{ name, isStreamedSceneAssetBundle }] }

Exact Signatures

精确签名

Exact names, parameters, defaults, and returns are defined by
GET /skills/schema
or
unity_skills.get_skill_schema()
, not by this file.
精确的名称、参数、默认值和返回值由
GET /skills/schema
unity_skills.get_skill_schema()
定义,而非本文档。