mirror of
https://github.com/tidys/cc-inspector-chrome
synced 2025-04-19 16:38:41 +00:00
完成实时监控的逻辑
This commit is contained in:
parent
e5e38d92b9
commit
bd0ac9b6a4
@ -116,7 +116,7 @@ export default class Index extends Vue {
|
|||||||
if (data) {
|
if (data) {
|
||||||
// 如果节点树为空,就刷新一次
|
// 如果节点树为空,就刷新一次
|
||||||
if (this.treeData.length === 0) {
|
if (this.treeData.length === 0) {
|
||||||
// this.onBtnClickUpdateTree();
|
this.onBtnClickUpdateTree();
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
this._reset();
|
this._reset();
|
||||||
@ -197,8 +197,6 @@ export default class Index extends Vue {
|
|||||||
|
|
||||||
handleNodeClick(data: TreeData) {
|
handleNodeClick(data: TreeData) {
|
||||||
this.selectedUUID = data.uuid;
|
this.selectedUUID = data.uuid;
|
||||||
// todo 去获取节点信息
|
|
||||||
// console.log(data);
|
|
||||||
let uuid = data.uuid;
|
let uuid = data.uuid;
|
||||||
if (uuid !== undefined) {
|
if (uuid !== undefined) {
|
||||||
this.runToContentScript(Msg.NodeInfo, uuid);
|
this.runToContentScript(Msg.NodeInfo, uuid);
|
||||||
@ -209,11 +207,13 @@ export default class Index extends Vue {
|
|||||||
if (this.watchEveryTime) {
|
if (this.watchEveryTime) {
|
||||||
this.timerID = setInterval(() => {
|
this.timerID = setInterval(() => {
|
||||||
this.onBtnClickUpdateTree();
|
this.onBtnClickUpdateTree();
|
||||||
}, 100);
|
if (this.selectedUUID) {
|
||||||
|
this.runToContentScript(Msg.NodeInfo, this.selectedUUID);
|
||||||
|
}
|
||||||
|
}, 300);
|
||||||
} else {
|
} else {
|
||||||
clearInterval(this.timerID);
|
clearInterval(this.timerID);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
runToContentScript(msg: Msg, data?: any) {
|
runToContentScript(msg: Msg, data?: any) {
|
||||||
|
@ -19,13 +19,13 @@ class CCInspector {
|
|||||||
|
|
||||||
init() {
|
init() {
|
||||||
console.log('cc-inspector init ~~~');
|
console.log('cc-inspector init ~~~');
|
||||||
// 注册cc_after_render事件
|
|
||||||
let timer = setInterval(() => {
|
let timer = setInterval(() => {
|
||||||
if (this._isCocosGame()) {
|
if (this._isCocosGame()) {
|
||||||
clearInterval(timer)
|
clearInterval(timer)
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
cc.director.on(cc.Director.EVENT_AFTER_SCENE_LAUNCH, () => {
|
cc.director.on(cc.Director.EVENT_AFTER_SCENE_LAUNCH, () => {
|
||||||
console.log('scene launch')
|
let isCocosGame = this._isCocosGame();
|
||||||
|
this.notifySupportGame(isCocosGame)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}, 300)
|
}, 300)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user