去掉了item+ 小强化 动画
This commit is contained in:
32
assets/script/game/map/LuckCardComp.ts
Normal file
32
assets/script/game/map/LuckCardComp.ts
Normal file
@@ -0,0 +1,32 @@
|
||||
import { _decorator, Animation, Component, Node, tween, v3 } from 'cc';
|
||||
const { ccclass, property } = _decorator;
|
||||
|
||||
@ccclass('LuckCardComp')
|
||||
export class LuckCardComp extends Component {
|
||||
timer:number=3;
|
||||
start() {
|
||||
this.timer=2
|
||||
console.log("[LuckCardComp]:start")
|
||||
}
|
||||
|
||||
update(deltaTime: number) {
|
||||
this.timer-=deltaTime
|
||||
if(this.timer<=0){
|
||||
let anim=this.node.getComponent(Animation)
|
||||
if(anim) anim.play("luckcardend")
|
||||
this.do_destroy()
|
||||
this.timer=2
|
||||
}
|
||||
}
|
||||
do_destroy(){
|
||||
tween(this.node)
|
||||
.to(0.2, {
|
||||
scale: v3(2,2,0),
|
||||
}, {onComplete:()=>{
|
||||
this.node.destroy()
|
||||
}})
|
||||
.start();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user