Files
heros/assets/script/game/skills/AnmEndCom.ts
2025-08-21 14:33:42 +08:00

22 lines
517 B
TypeScript

import { _decorator, Animation, Component, Node } from 'cc';
const { ccclass, property } = _decorator;
@ccclass('AnmEndCom')
export class AnmEndCom extends Component {
start() {
if(this.node.getComponent(Animation)){
let anim = this.node.getComponent(Animation);
// console.log("has anim",anim)
anim.on(Animation.EventType.FINISHED, this.onAnimationFinished, this);
}
}
onAnimationFinished(){
this.node.destroy()
}
}