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) { } }