mirror of
https://github.com/tidys/cc-inspector-chrome
synced 2025-04-15 14:41:05 +00:00
54 lines
1.0 KiB
Markdown
54 lines
1.0 KiB
Markdown
## 注入脚本收集的数据结构
|
|
节点树数据结构
|
|
```json
|
|
{
|
|
"scene": {
|
|
"type":"1",// 类型
|
|
"uuid": "scene-uuid",
|
|
"name": "scene-name",
|
|
"children": [
|
|
{
|
|
"uuid": "node-uuid",
|
|
"name": "node-name",
|
|
"type": "cc_Node",
|
|
"x": 960.48,
|
|
"y": 540,
|
|
"zIndex": 0,
|
|
"width": 1920.96,
|
|
"height": 1080,
|
|
"active": true,
|
|
"color": "#ffffff",
|
|
"opacity": 255,
|
|
"rotation": 0,
|
|
"rotationX": 0,
|
|
"rotationY": 0,
|
|
"anchorX": 0.5,
|
|
"anchorY": 0.5,
|
|
"scaleX": 1,
|
|
"scaleY": 1,
|
|
"skewX": 0,
|
|
"skewY": 0,
|
|
"childrenCount": 5,
|
|
"children": []
|
|
},
|
|
{
|
|
"uuid":"..."
|
|
}
|
|
]
|
|
}
|
|
}
|
|
```
|
|
缓存游戏真实的内存结构,window.inspectorGameMemoryStorage
|
|
```json
|
|
{
|
|
"node-uuid":"node-memory"
|
|
}
|
|
```
|
|
在遍历节点树的同时,会存储游戏实际的内存数据到inspectorGameMemoryStorage
|
|
|
|
## 获取某个节点信息
|
|
```
|
|
window.getNodeInfo
|
|
```
|
|
|