mirror of
https://github.com/potato47/ccc-devtools.git
synced 2024-12-26 03:39:16 +00:00
add readme
This commit is contained in:
parent
a161db4eee
commit
199209fb23
34
README.md
34
README.md
@ -1,6 +1,38 @@
|
|||||||
# ccc-devtools
|
# ccc-devtools v1.0
|
||||||
Cocos Creator 网页调试器,运行时查看、修改节点树,实时更新节点属性。
|
Cocos Creator 网页调试器,运行时查看、修改节点树,实时更新节点属性。
|
||||||
|
|
||||||
|
## 功能
|
||||||
|
|
||||||
|
- [x] 拖拽布局
|
||||||
|
- [x] 节点搜索
|
||||||
|
- [x] 实时刷新节点信息
|
||||||
|
- [ ] 自定义布局等配置
|
||||||
|
- [ ] 组件信息
|
||||||
|
|
||||||
|
## 预览
|
||||||
|
|
||||||
|
![preview](./screenshots/preview.gif)
|
||||||
|
|
||||||
|
## 使用
|
||||||
|
|
||||||
|
1. 点击 Creator 右上角进入编辑器 resources 目录,再依次进入`static/preview-templates`目录
|
||||||
|
|
||||||
|
![t1](./screenshots/t1.png)
|
||||||
|
|
||||||
|
2. 将本项目clone到上面的目录下
|
||||||
|
|
||||||
|
![t2](./screenshots/t2.png)
|
||||||
|
|
||||||
|
3. 打开`index.jade`,找到`body`里最后一个`div`,在下面添加`include ./ccc-devtools/index.html`
|
||||||
|
|
||||||
|
![t3](./screenshots/t3.png)
|
||||||
|
|
||||||
|
|
||||||
|
## 已知问题
|
||||||
|
|
||||||
|
- 当有大量节点动态加载时,可能需要手动点击一下右上角的刷新按钮来重载节点树。
|
||||||
|
- 当升级 Cococs Creator 时会清空resources目录,需要重新下载配置,如自定义了一些配置,请做好备份。
|
||||||
|
|
||||||
|
## 需求、更新
|
||||||
|
|
||||||
https://github.com/potato47/ccc-devtools
|
https://github.com/potato47/ccc-devtools
|
11
index.html
11
index.html
@ -212,16 +212,21 @@
|
|||||||
this.$refs.sceneTree.filter(val);
|
this.$refs.sceneTree.filter(val);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
created: function() {
|
created: function () {
|
||||||
let top = document.getElementById('top')
|
let top = document.getElementById('top')
|
||||||
// top.insertBefore(document.getElementsByClassName('toolbar')[0], top.firstChild);
|
// top.insertBefore(document.getElementsByClassName('toolbar')[0], top.firstChild);
|
||||||
top.appendChild(document.getElementsByClassName('toolbar')[0]);
|
top.appendChild(document.getElementsByClassName('toolbar')[0]);
|
||||||
document.getElementById('game_panel').appendChild(document.getElementById('content'));
|
document.getElementById('game_panel').appendChild(document.getElementById('content'));
|
||||||
// let content = document.getElementById('content');
|
// let content = document.getElementById('content');
|
||||||
// content.insertBefore(document.getElementById('searchInput'), content.firstChild);
|
// content.insertBefore(document.getElementById('searchInput'), content.firstChild);
|
||||||
|
|
||||||
intervalId = setInterval(() => {
|
intervalId = setInterval(() => {
|
||||||
if (window.cc) {
|
if (window.cc) {
|
||||||
|
let scene = cc.director.getScene();
|
||||||
|
if (scene) {
|
||||||
|
this.$data.sceneTreeData = scene.children;
|
||||||
|
this.defaultExpandedKeys = [this.$data.sceneTreeData[0]._id];
|
||||||
|
}
|
||||||
cc.director.on(cc.Director.EVENT_AFTER_SCENE_LAUNCH, () => {
|
cc.director.on(cc.Director.EVENT_AFTER_SCENE_LAUNCH, () => {
|
||||||
this.$data.sceneTreeData = cc.director.getScene().children;
|
this.$data.sceneTreeData = cc.director.getScene().children;
|
||||||
this.defaultExpandedKeys = [this.$data.sceneTreeData[0]._id];
|
this.defaultExpandedKeys = [this.$data.sceneTreeData[0]._id];
|
||||||
@ -237,4 +242,4 @@
|
|||||||
}, 1000);
|
}, 1000);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
BIN
screenshots/preview.gif
Normal file
BIN
screenshots/preview.gif
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.5 MiB |
BIN
screenshots/t1.png
Normal file
BIN
screenshots/t1.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 9.2 KiB |
BIN
screenshots/t2.png
Normal file
BIN
screenshots/t2.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 45 KiB |
BIN
screenshots/t3.png
Normal file
BIN
screenshots/t3.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 59 KiB |
Loading…
Reference in New Issue
Block a user