const { ccclass, property } = cc._decorator;

@ccclass
export default class propMove extends cc.Component {
  /** 死亡动画 */
  async die(cb) {
    const ani = this.node.getComponent(cc.Animation)
    if (ani) {
      ani.play()
      ani.on('finished', async () => {
        await cb?.()
        this.node.destroy()
      }, this)
    } else {
      await cb?.()
      this.node.destroy()
    }
  }
}
