feat: dying and died events
This commit is contained in:
parent
ab37214926
commit
2b3fca9d9a
|
@ -142,6 +142,7 @@ export class Alive extends decorate(Trait) {
|
|||
if (this._dyingTickingPromise) {
|
||||
return;
|
||||
}
|
||||
this.entity.emit('dying');
|
||||
this.state.isDying = true;
|
||||
this.entity._fastDirtyCheck = true;
|
||||
this._fastDirtyCheck = true;
|
||||
|
@ -149,6 +150,7 @@ export class Alive extends decorate(Trait) {
|
|||
this._context
|
||||
)
|
||||
this._dyingTickingPromise.then(() => {
|
||||
this.entity.emit('died');
|
||||
this.entity.destroy();
|
||||
});
|
||||
},
|
||||
|
|
Loading…
Reference in New Issue
Block a user