mirror of
https://github.com/photonstorm/phaser
synced 2024-11-30 00:21:04 +00:00
DataManagerPlugin would throw an error on Game.destroy if you had any Scenes in the Scene Manager had not been run. Fix #3596
This commit is contained in:
parent
4018d6ab39
commit
e3aa437340
3 changed files with 3 additions and 10 deletions
|
@ -13,7 +13,7 @@
|
|||
|
||||
### Bug Fixes
|
||||
|
||||
|
||||
* DataManagerPlugin would throw an error on Game.destroy if you had any Scenes in the Scene Manager had not been run. Fix #3596 (thanks @kuoruan)
|
||||
|
||||
|
||||
## Version 3.6.0 - Asuna - 19th April 2018
|
||||
|
|
|
@ -92,7 +92,7 @@ var DataManager = new Class({
|
|||
*/
|
||||
this._frozen = false;
|
||||
|
||||
if (this.events)
|
||||
if (!parent.hasOwnProperty('sys') && this.events)
|
||||
{
|
||||
this.events.once('destroy', this.destroy, this);
|
||||
}
|
||||
|
|
|
@ -80,13 +80,6 @@ var DataManagerPlugin = new Class({
|
|||
*/
|
||||
start: function ()
|
||||
{
|
||||
if (this.events)
|
||||
{
|
||||
this.events.off('destroy', this.destroy, this);
|
||||
}
|
||||
|
||||
this.events = this.systems.events;
|
||||
|
||||
this.events.once('shutdown', this.shutdown, this);
|
||||
},
|
||||
|
||||
|
@ -114,7 +107,7 @@ var DataManagerPlugin = new Class({
|
|||
{
|
||||
DataManager.prototype.destroy.call(this);
|
||||
|
||||
this.systems.events.off('start', this.start, this);
|
||||
this.events.off('start', this.start, this);
|
||||
|
||||
this.scene = null;
|
||||
this.systems = null;
|
||||
|
|
Loading…
Reference in a new issue