import { _decorator, Component, Label, Node, tween, Vec3 } from 'cc'; const { ccclass, property } = _decorator; @ccclass('CoinFly') export class CoinFly extends Component { protected onLoad(): void { } flyAni(endPos:Vec3, callfunc = null){ tween(this.node) .by(0.5, { y:50 }, { easing: 'backOut' }) .by(0.5, { y:-50 }, { easing: 'backOut' }) .delay(0.3) .to(0.1+Math.random() * 0.1, { worldPosition: endPos }) .call(() => { if(callfunc){ callfunc() } gg.res.putNode(this.node) }) .start(); } }