const { ccclass, property, requireComponent } = cc._decorator; @ccclass export default class Transfer extends cc.Component { private closeCallback: () => void = null; onLoad() { this.init(); ['coin_guang', 'hammer_guang', 'magic_guang', 'ice_guang'].forEach(name => { const node = this.node.getChildByName(name); if (node) node.runAction(cc.rotateBy(6, 360).repeatForever()); }); } init(closeCallback?: () => void) { if (closeCallback) { this.closeCallback = closeCallback; } } close() { if (this.closeCallback) { this.closeCallback(); return; } this.node.destroy(); } clickTransfer() { cc.fx.GameTool.onClickOtherGame(); } }