调试信息效果
接口
export interface IProfilerState {
frame: __private.cocos_profiler_counter_ICounterOption;
fps: __private.cocos_profiler_counter_ICounterOption;
draws: __private.cocos_profiler_counter_ICounterOption;
instances: __private.cocos_profiler_counter_ICounterOption;
tricount: __private.cocos_profiler_counter_ICounterOption;
logic: __private.cocos_profiler_counter_ICounterOption;
physics: __private.cocos_profiler_counter_ICounterOption;
render: __private.cocos_profiler_counter_ICounterOption;
textureMemory: __private.cocos_profiler_counter_ICounterOption;
bufferMemory: __private.cocos_profiler_counter_ICounterOption;
}
export class Profiler {
_stats: IProfilerState | null;
id: string;
constructor();
/** 当前是否显示调试信息界面 */
isShowingStats(): boolean;
/** 隐藏调试信息 */
hideStats(): void;
/** 显示调试信息 */
showStats(): void;
generateCanvas(): void;
/** 生成调试信息状态 */
generateStats(): void;
/** 生成调试信息节点 */
generateNode(): void;
/** 以下均为事件的监听回调函数 */
beforeUpdate(): void;
afterUpdate(): void;
beforePhysics(): void;
afterPhysics(): void;
beforeDraw(): void;
afterDraw(): void;
}
export const profiler: Profiler;
总结
IProfilerState 类中属性对应的就是效果图内显示得信息.
大家常用得也就 isShowingStats()、hideStats()、showStats() 理解意思了就好!!!