怎么难道已经实例化的预制体上面的脚本啊

##希望大牛们指点

node.getComponent(“脚本名”);
建议先看看文档。

这只能拿到第一个,才入了多个同名的预制体,怎么一次过拿到他们的脚本

parent.children.forEach(node=>node.getComponent(“脚本名”) return cc.Component);

// 拿节点上同名组件
parent.children.forEach(node=>node.getComponents(“脚本名”) return cc.Component[]);