cocos-web-inspector-mcp 1.0.0 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/src/bridge.js +4 -0
- package/package.json +1 -1
package/dist/src/bridge.js
CHANGED
|
@@ -434,6 +434,10 @@ export function inspectCocos(request) {
|
|
|
434
434
|
return undefined;
|
|
435
435
|
// Cocos 3.x exposes uuid/children/name as accessors; read their backing fields instead.
|
|
436
436
|
const uuid = dataProperty(value, 'uuid') ?? dataProperty(value, '_id');
|
|
437
|
+
// CCObject.isValid is a getter over this flag (Destroyed = 1 << 0 in 3.6-3.8); destroy also nulls _children/node.
|
|
438
|
+
const flags = dataProperty(value, '_objFlags');
|
|
439
|
+
if (reference && typeof flags === 'number' && flags & 1)
|
|
440
|
+
return { $type: typeof cc.Node === 'function' && value instanceof cc.Node ? 'Node' : componentName(value), uuid: String(uuid ?? ''), destroyed: true };
|
|
437
441
|
if (reference && uuid && Array.isArray(dataProperty(value, 'children') ?? dataProperty(value, '_children'))) {
|
|
438
442
|
return { $type: 'Node', uuid: String(uuid), name: String(dataProperty(value, 'name') ?? dataProperty(value, '_name') ?? '').slice(0, 500) };
|
|
439
443
|
}
|