Files
heros/assets/script/game/skills/dead.ts
2024-08-11 16:50:42 +08:00

19 lines
424 B
TypeScript

import { _decorator, Component, Node ,Animation} from 'cc';
const { ccclass, property } = _decorator;
@ccclass('dead')
export class dead extends Component {
start() {
let anim = this.node.getComponent(Animation);
anim.on(Animation.EventType.FINISHED, this.onAnimationFinished, this);
}
onAnimationFinished(){
this.node.destroy();
}
update(deltaTime: number) {
}
}