19 lines
424 B
TypeScript
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) {
|
|
|
|
}
|
|
}
|
|
|
|
|