mirror of
https://github.com/wassname/phaser.git
synced 2026-08-03 13:10:25 +08:00
Fix bug in StateManager where a state's update function might not get called if it has an empty preload function
This commit is contained in:
@@ -259,13 +259,6 @@ Phaser.StateManager.prototype = {
|
||||
{
|
||||
// console.log('Loader queue empty');
|
||||
this.game.loadComplete();
|
||||
|
||||
if (this.onCreateCallback)
|
||||
{
|
||||
this.onCreateCallback.call(this.callbackContext);
|
||||
}
|
||||
|
||||
this._created = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -278,14 +271,6 @@ Phaser.StateManager.prototype = {
|
||||
{
|
||||
// console.log('Preload callback not found');
|
||||
// No init? Then there was nothing to load either
|
||||
if (this.onCreateCallback)
|
||||
{
|
||||
// console.log('Create callback found');
|
||||
this.onCreateCallback.call(this.callbackContext);
|
||||
}
|
||||
|
||||
this._created = true;
|
||||
|
||||
this.game.loadComplete();
|
||||
}
|
||||
|
||||
@@ -383,9 +368,9 @@ Phaser.StateManager.prototype = {
|
||||
if (this._created == false && this.onCreateCallback)
|
||||
{
|
||||
// console.log('Create callback found');
|
||||
this._created = true;
|
||||
this.onCreateCallback.call(this.callbackContext);
|
||||
}
|
||||
this._created = true;
|
||||
|
||||
},
|
||||
|
||||
@@ -455,4 +440,4 @@ Phaser.StateManager.prototype = {
|
||||
|
||||
}
|
||||
|
||||
};
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user