插件里可以访问当前正在编辑的场景吗?

以及其中的节点。

或者能否instantiate一个prefab?

哈?什么意思,有点不明白…

http://www.cocos.com/docs/creator/extension/entry-point.html

我希望自定义一个菜单,点击后,可以遍历当前正在编辑的场景中的节点。

问题是,接收IPC到消息后,怎么访问正在编辑的场景?比如可以写Editor.currentScene.children之类的

目前场景接口还比较简陋,都需要通过 ipc 获得 dump 数据,拿到 node id 后继续通过 ipc 获得对应 node 的 dump 数据.

Editor.Ipc.sendToPanel( 'scene', 'scene:query-hierarchy', (event, uuid, nodes) => {
   ...
} );

未来我们会考虑做成更方便的 Editor.Scene 模块提供给插件开发者使用