unity-profiler
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseBefore 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) first. If you already have the parameter definitions from recommend/schema, you may proceed straight to dryRun.GET /skills/recommend?includeSchema=true
调用本模块中的任何skill前: 如果您打算根据skill的名称或描述猜测参数来调用,请停止——先阅读本文档(或通过获取其schema)。如果您已经从推荐/schema中获取了参数定义,可以直接进行dryRun。GET /skills/recommend?includeSchema=true
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 直接执行。本模块全部标 ,三档模式下都不需要 grant。
ReadOnly = true, Mode = SkillMode.SemiAuto - 本模块不含 Delete / PlayMode / Reload / RiskLevel=high 类 skill —— 没有 拦截。
IsForbiddenInSemi - 注:本组 skill 仅做"瞬时快照"读取,不是 Profiler 录制控制;持续采样请用 Unity Profiler 窗口。
DO NOT (common hallucinations):
- /
profiler_startdo not exist → profiler skills are read-only snapshots, not recording controlsprofiler_stop - does not exist → use Unity Profiler window for recording
profiler_record - /
profiler_analyzedo not exist → useprofiler_get_fps(FPS, batches, draw calls) orprofiler_get_stats(heap sizes)profiler_get_memory
Routing:
- For scene performance hints → use module's
perceptionscene_performance_hints - For memory info → (debug module) or
debug_get_memory_info(this module)profiler_get_memory - For optimization suggestions → use module
optimization
- Approval / Auto / Bypass:所有skill直接执行。本模块全部标记为 ,三种模式下均无需授权(grant)。
ReadOnly = true, Mode = SkillMode.SemiAuto - 本模块不含 Delete / PlayMode / Reload / RiskLevel=high 类型的skill —— 不存在 拦截。
IsForbiddenInSemi - 注:本组skill仅用于"瞬时快照"读取,并非Profiler录制控制;如需持续采样,请使用Unity Profiler窗口。
请勿执行以下操作(常见误区):
- /
profiler_start不存在 → Profiler skill是只读快照,并非录制控制工具profiler_stop - 不存在 → 如需录制,请使用Unity Profiler窗口
profiler_record - /
profiler_analyze不存在 → 请使用profiler_get_fps(获取FPS、批处理、绘制调用)或profiler_get_stats(获取堆内存大小)profiler_get_memory
路由指引:
- 如需场景性能提示 → 使用模块的
perceptionscene_performance_hints - 如需内存信息 → (debug模块)或
debug_get_memory_info(本模块)profiler_get_memory - 如需优化建议 → 使用模块
optimization
Skills
Skills
profiler_get_stats
profiler_get_statsprofiler_get_stats
profiler_get_statsGet 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_memoryprofiler_get_memory
profiler_get_memoryGet 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_memoryprofiler_get_runtime_memory
profiler_get_runtime_memoryGet top N objects by runtime memory usage in the scene.
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
| limit | int | No | 20 | Maximum number of objects to return |
Returns:
{ success, totalTrackedMB, showing, objects: [{ name, type, sizeKB }] }获取场景中运行时内存占用Top N的对象。
| 参数 | 类型 | 是否必填 | 默认值 | 描述 |
|---|---|---|---|---|
| limit | int | 否 | 20 | 返回的最大对象数量 |
返回值:
{ success, totalTrackedMB, showing, objects: [{ name, type, sizeKB }] }profiler_get_texture_memory
profiler_get_texture_memoryprofiler_get_texture_memory
profiler_get_texture_memoryGet memory usage of all loaded textures.
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
| limit | int | No | 50 | Maximum number of textures to return |
Returns:
{ success, totalCount, totalMB, topTextures: [{ name, type, sizeKB, width, height }] }获取所有已加载纹理的内存使用情况。
| 参数 | 类型 | 是否必填 | 默认值 | 描述 |
|---|---|---|---|---|
| limit | int | 否 | 50 | 返回的最大纹理数量 |
返回值:
{ success, totalCount, totalMB, topTextures: [{ name, type, sizeKB, width, height }] }profiler_get_mesh_memory
profiler_get_mesh_memoryprofiler_get_mesh_memory
profiler_get_mesh_memoryGet memory usage of all loaded meshes.
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
| limit | int | No | 50 | Maximum number of meshes to return |
Returns:
{ success, totalCount, totalMB, topMeshes: [{ name, sizeKB, vertices, triangles }] }获取所有已加载网格的内存使用情况。
| 参数 | 类型 | 是否必填 | 默认值 | 描述 |
|---|---|---|---|---|
| limit | int | 否 | 50 | 返回的最大网格数量 |
返回值:
{ success, totalCount, totalMB, topMeshes: [{ name, sizeKB, vertices, triangles }] }profiler_get_material_memory
profiler_get_material_memoryprofiler_get_material_memory
profiler_get_material_memoryGet memory usage of all loaded materials.
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
| limit | int | No | 50 | Maximum number of materials to return |
Returns:
{ success, totalCount, totalMB, topMaterials: [{ name, shader, sizeKB }] }获取所有已加载材质的内存使用情况。
| 参数 | 类型 | 是否必填 | 默认值 | 描述 |
|---|---|---|---|---|
| limit | int | 否 | 50 | 返回的最大材质数量 |
返回值:
{ success, totalCount, totalMB, topMaterials: [{ name, shader, sizeKB }] }profiler_get_audio_memory
profiler_get_audio_memoryprofiler_get_audio_memory
profiler_get_audio_memoryGet memory usage of all loaded AudioClips.
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
| limit | int | No | 50 | Maximum number of clips to return |
Returns:
{ success, totalCount, totalMB, topClips: [{ name, sizeKB, length, channels, frequency }] }获取所有已加载AudioClip的内存使用情况。
| 参数 | 类型 | 是否必填 | 默认值 | 描述 |
|---|---|---|---|---|
| limit | int | 否 | 50 | 返回的最大音频片段数量 |
返回值:
{ success, totalCount, totalMB, topClips: [{ name, sizeKB, length, channels, frequency }] }profiler_get_object_count
profiler_get_object_countprofiler_get_object_count
profiler_get_object_countCount all loaded objects grouped by type.
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
| topN | int | No | 20 | Number of top types to return |
Returns:
{ success, totalObjects, topTypes: [{ type, count }] }按类型统计所有已加载对象的数量。
| 参数 | 类型 | 是否必填 | 默认值 | 描述 |
|---|---|---|---|---|
| topN | int | 否 | 20 | 返回的Top类型数量 |
返回值:
{ success, totalObjects, topTypes: [{ type, count }] }profiler_get_rendering_stats
profiler_get_rendering_statsprofiler_get_rendering_stats
profiler_get_rendering_statsGet 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_statsprofiler_get_asset_bundle_stats
profiler_get_asset_bundle_statsGet 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 or , not by this file.
GET /skills/schemaunity_skills.get_skill_schema()精确的名称、参数、默认值和返回值由或定义,而非本文档。
GET /skills/schemaunity_skills.get_skill_schema()