refactor: destroy async to avoid issues within tick
This commit is contained in:
parent
2b3fca9d9a
commit
0a7c60e8b7
|
@ -36,8 +36,10 @@ export class Existent extends decorate(Trait) {
|
|||
}
|
||||
this._isDestroying = true;
|
||||
this.entity.isTicking = false;
|
||||
return Promise.resolve().then(() => {
|
||||
this.entity.emit('destroy');
|
||||
this.entity.emit('destroyed');
|
||||
});
|
||||
},
|
||||
|
||||
destroyGently: () => {
|
||||
|
|
Loading…
Reference in New Issue
Block a user