30 lines
764 B
TypeScript
30 lines
764 B
TypeScript
import { _decorator, Component, Node, sp ,Animation, AnimationState} from 'cc';
|
|
import { Timer } from '../../../../extensions/oops-plugin-framework/assets/core/common/timer/Timer';
|
|
const { ccclass, property ,} = _decorator;
|
|
|
|
@ccclass('anonce')
|
|
export class anonce extends Component {
|
|
|
|
timer:Timer=new Timer(0.5);
|
|
|
|
start() {
|
|
|
|
}
|
|
protected onLoad(): void {
|
|
|
|
}
|
|
|
|
update(deltaTime: number) {
|
|
if(this.node.active){
|
|
if(!this.node.getChildByName("skill").getComponent(Animation).getState("heathed").isPlaying){
|
|
this.node.getChildByName("skill").getComponent(Animation).play();
|
|
}
|
|
if (this.timer.update(deltaTime)) {
|
|
this.node.active=false;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|