let tween = cc.tween(item)
//幾個tween同時進行
.parallel(
//兼容多種寫法
cc.jumpTo(time, cc.v2(this.curCardBg.x, this.curCardBg.y), 300, 1),
cc.tween().to(time, {angle : -360})
cc.rotateBy(time,360)
)
.to(1, { scale: 2 }, { easing: 'sineOutIn'})//傳入 easing 名字,直接使用內置 easing 函數
.by(1, { scale: 2 }, { easing: t => t*t })// 使用自定義 easing 函數
.to({scale: 2, position: { value: cc.v3(100, 100, 100), easing: 'sineOutIn' }})//value 必須與 easing 或者 progress 配合使用
.call(() => {
this.curCardBg.getComponent(cc.Sprite).spriteFrame = item.getComponent(cc.Sprite).spriteFrame;
item.active = false;
this.hitCardBl = true;
})
.start()
// 復制 tween,並使用節點 Canvas/cocos 作為 target
tween.clone(cc.find('Canvas/cocos')).start()