mirror of
https://github.com/photonstorm/phaser
synced 2024-11-25 14:10:42 +00:00
The GameObject destroy
event is now emitted at the start of the destroy process, before things like the body or input managers have been removed, so you're able to use the event handler to extract any information you require from the GameObject before it's actually disposed of. Previously, the event was dispatched at the very end of the process.
This commit is contained in:
parent
8d7ed97d38
commit
cb5b12e9d3
2 changed files with 3 additions and 2 deletions
|
@ -93,6 +93,7 @@ A special mention must go to @orblazer for their outstanding assistance in helpi
|
|||
* Triangle.getLineA now returns a Line instead of an untyped object. It also now has an optional argument that allows you to pass a Line in to be populated, rather than creating a new one.
|
||||
* Triangle.getLineB now returns a Line instead of an untyped object. It also now has an optional argument that allows you to pass a Line in to be populated, rather than creating a new one.
|
||||
* Triangle.getLineC now returns a Line instead of an untyped object. It also now has an optional argument that allows you to pass a Line in to be populated, rather than creating a new one.
|
||||
* The GameObject `destroy` event is now emitted at the start of the destroy process, before things like the body or input managers have been removed, so you're able to use the event handler to extract any information you require from the GameObject before it's actually disposed of. Previously, the event was dispatched at the very end of the process.
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -331,6 +331,8 @@ var GameObject = new Class({
|
|||
this.preDestroy.call(this);
|
||||
}
|
||||
|
||||
this.emit('destroy', this);
|
||||
|
||||
var sys = this.scene.sys;
|
||||
|
||||
sys.displayList.remove(this);
|
||||
|
@ -363,8 +365,6 @@ var GameObject = new Class({
|
|||
|
||||
this.scene = undefined;
|
||||
|
||||
this.emit('destroy');
|
||||
|
||||
this.removeAllListeners();
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue