mirror of
https://github.com/wassname/phaser.git
synced 2026-07-24 13:10:53 +08:00
State swap example done and working.
This commit is contained in:
@@ -151,6 +151,7 @@ Phaser.StateManager.prototype = {
|
||||
{
|
||||
// console.log('Phaser.StateManager.addState: Object given');
|
||||
newState = state;
|
||||
newState.game = this.game;
|
||||
}
|
||||
else if (typeof state === 'function')
|
||||
{
|
||||
@@ -237,9 +238,10 @@ Phaser.StateManager.prototype = {
|
||||
|
||||
if (clearWorld) {
|
||||
|
||||
//this.game.world.destroy();
|
||||
this.game.world.destroy();
|
||||
|
||||
if (clearCache == true) {
|
||||
if (clearCache == true)
|
||||
{
|
||||
this.game.cache.destroy();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user