SuperAPI AI 工具集

unity-profiler

通用与其它

查看项目

更新于 10-15 17:25

技能介绍

用途:在 Unity 运行时读取性能与内存快照,辅助定位帧率、批次、绘制调用和资源占用问题。本模块全部为只读瞬时快照,不是 Profiler 录制控制;需要持续采样时请使用 Unity Profiler 窗口。

主要能力:profiler_get_stats 获取 FPS、三角形、batches、内存概况;profiler_get_memory 查看总分配/保留/mono 堆;profiler_get_runtime_memory 按运行时内存列出场景对象(limit 默认 20);profiler_get_texture_memory、profiler_get_mesh_memory、profiler_get_material_memory、profiler_get_audio_memory 分别列出纹理、网格、材质、AudioClip 占用(limit 默认 50);profiler_get_object_count 按类型统计对象数(topN 默认 20);profiler_get_rendering_stats 返回帧时间、渲染时间、三角形、顶点、batches、drawCalls 等;profiler_get_asset_bundle_stats 列出已加载 AssetBundle。

使用方式:调用前先读取技能 schema 或通过 GET /skills/recommend?includeSchema=true 获取参数定义,避免凭名称猜测参数;参数确定后可直接 dryRun。本模块均标 ReadOnly=true、Mode=SkillMode.SemiAuto,三档模式下都不需要授权,且不含 Delete、PlayMode、Reload、RiskLevel=high 类技能。

适用场景:快速检查运行帧率与绘制开销、排查内存与资源占用、查看场景对象和 AssetBundle 加载情况。场景性能提示可用 perception 模块的 scene_performance_hints,内存也可用 debug 模块的 debug_get_memory_info,优化建议请用 optimization 模块。

限制:不存在 profiler_start、profiler_stop、profiler_record、profiler_analyze、profiler_get_fps 等技能;录制请用 Unity Profiler 窗口。参数默认值与返回结构的权威定义以 GET /skills/schema 或 unity_skills.get_skill_schema() 为准。官方文档未提供收费、价格、平台与效果信息。