mirror of
https://github.com/tidys/cc-inspector-chrome
synced 2025-04-16 07:01:03 +00:00
fsp显示隐藏
This commit is contained in:
parent
f014c62f75
commit
12ddbf8ac9
@ -93,6 +93,7 @@ export enum Msg {
|
||||
|
||||
ResponseMemoryInfo = "response-memory-info",
|
||||
MemoryInfo = "memory-info",
|
||||
VisibleFPS = "visible-fps",
|
||||
/**
|
||||
* 当前页面信息
|
||||
*/
|
||||
|
@ -26,6 +26,23 @@ export class Inspector extends InjectEvent {
|
||||
this.updateTreeInfo();
|
||||
break;
|
||||
}
|
||||
case Msg.VisibleFPS: {
|
||||
const b = pluginEvent.data as boolean;
|
||||
if (b) {
|
||||
if (cc.profiler?.showStats) {
|
||||
cc.profiler.showStats();
|
||||
} else if (cc.debug?.setDisplayStats) {
|
||||
cc.debug.setDisplayStats(true);
|
||||
}
|
||||
} else {
|
||||
if (cc.profiler?.hideStats) {
|
||||
cc.profiler.hideStats();
|
||||
} else if (cc.debug?.setDisplayStats) {
|
||||
cc.debug.setDisplayStats(false);
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
case Msg.RequestGameInfo: {
|
||||
const ret = new ResponseGameInfoData();
|
||||
const atlasManager = cc?.dynamicAtlasManager || cc.internal?.dynamicAtlasManager || null;
|
||||
|
@ -39,12 +39,12 @@ export default defineComponent({
|
||||
};
|
||||
const funcEnableSchedule = (b: boolean) => {
|
||||
if (b) {
|
||||
timer.create();
|
||||
timer_hierarchy.create();
|
||||
} else {
|
||||
timer.clean();
|
||||
timer_hierarchy.clean();
|
||||
}
|
||||
};
|
||||
const timer: Timer = new Timer(() => {
|
||||
const timer_hierarchy: Timer = new Timer(() => {
|
||||
updateTree();
|
||||
});
|
||||
let ins: MousetrapInstance | null = null;
|
||||
@ -68,7 +68,7 @@ export default defineComponent({
|
||||
Bus.on(BusMsg.ChangeContent, changeContent);
|
||||
Bus.on(BusMsg.ShowPlace, funcShowPlace);
|
||||
Bus.on(BusMsg.EnableSchedule, funcEnableSchedule);
|
||||
timer.create();
|
||||
timer_hierarchy.create();
|
||||
});
|
||||
onUnmounted(() => {
|
||||
if (ins) {
|
||||
@ -77,7 +77,7 @@ export default defineComponent({
|
||||
Bus.off(BusMsg.ChangeContent, changeContent);
|
||||
Bus.off(BusMsg.ShowPlace, funcShowPlace);
|
||||
Bus.off(BusMsg.EnableSchedule, funcEnableSchedule);
|
||||
timer.clean();
|
||||
timer_hierarchy.clean();
|
||||
});
|
||||
function _expand(uuid: string) {
|
||||
if (elTree.value) {
|
||||
@ -215,6 +215,31 @@ export default defineComponent({
|
||||
updateTree();
|
||||
},
|
||||
});
|
||||
menus.push({
|
||||
name: "fresh auto",
|
||||
callback: () => {
|
||||
timer_hierarchy.create();
|
||||
},
|
||||
});
|
||||
menus.push({
|
||||
name: "fresh manual",
|
||||
callback: () => {
|
||||
timer_hierarchy.clean();
|
||||
},
|
||||
});
|
||||
menus.push({
|
||||
name: "fps show",
|
||||
callback: () => {
|
||||
bridge.send(Msg.VisibleFPS, true);
|
||||
},
|
||||
});
|
||||
|
||||
menus.push({
|
||||
name: "fps hide",
|
||||
callback: () => {
|
||||
bridge.send(Msg.VisibleFPS, false);
|
||||
},
|
||||
});
|
||||
menus.push({
|
||||
name: "game info",
|
||||
callback() {
|
||||
|
Loading…
x
Reference in New Issue
Block a user