在做插件开发,发现
let components = await Editor.Message.request('scene', 'query-component', uuid);
会返回 null,
而使用:
let node = await Editor.Message.request('scene', 'query-node', uuid);
let found = false;
for (let i = 0; i < node.__comps__.length; i++) {
let comp = node.__comps__[i];
if (comp.type == "TypeYouAreFinding") {
found = true;
break;
}
}
按理说 scene.query-component 应该会返回 node.__comps__
这个dump吧