mirror of
https://gitee.com/jisol/jisol-game/
synced 2025-06-26 11:24:46 +00:00
40 lines
777 B
TypeScript
40 lines
777 B
TypeScript
|
import { tween } from 'cc';
|
||
|
import { v3 } from 'cc';
|
||
|
import { Label } from 'cc';
|
||
|
import { _decorator, Component, Node } from 'cc';
|
||
|
const { ccclass, property } = _decorator;
|
||
|
|
||
|
@ccclass('ModeRenderHitText')
|
||
|
export class ModeRenderHitText extends Component {
|
||
|
|
||
|
@property(Label)
|
||
|
hitLabel:Label;
|
||
|
|
||
|
setText(hit:number){
|
||
|
|
||
|
this.hitLabel.string = `${hit}`;
|
||
|
|
||
|
this.setAnimation();
|
||
|
|
||
|
}
|
||
|
|
||
|
//设置动画
|
||
|
setAnimation(){
|
||
|
|
||
|
this.node.scale = v3(0,0,0);
|
||
|
|
||
|
tween(this.node)
|
||
|
.to(.5,{position:this.node.position.clone().add(v3(0,100,0)),scale:v3(1,1,1)},{
|
||
|
onComplete:() => {
|
||
|
this.node.destroy();
|
||
|
},
|
||
|
easing:"quadInOut"
|
||
|
})
|
||
|
.start();
|
||
|
|
||
|
}
|
||
|
|
||
|
}
|
||
|
|
||
|
|