如何在挂有各种组件的节点上 获取到所有脚本

如题,想写一个公用的脚本,卡在这里了

所有组件脚本都继承 cc.Component ,所以这样可以全获取到:
this.node.getComponents(cc.Component);