Skip to content

Commit 0d497fd

Browse files
committed
Fixed Scene restart shutdown flow
1 parent 9352885 commit 0d497fd

1 file changed

Lines changed: 25 additions & 21 deletions

File tree

src/scene/SceneManager.js

Lines changed: 25 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1104,34 +1104,38 @@ var SceneManager = new Class({
11041104
{
11051105
// If the Scene is already running (perhaps they called start from a launched sub-Scene?)
11061106
// then we close it down before starting it again.
1107-
if (scene.sys.isActive())
1107+
if (scene.sys.isActive() || scene.sys.isPaused())
11081108
{
11091109
scene.sys.shutdown();
1110-
}
1111-
1112-
scene.sys.start(data);
1113-
1114-
var loader;
11151110

1116-
if (scene.sys.load)
1117-
{
1118-
loader = scene.sys.load;
1111+
scene.sys.start(data);
11191112
}
1120-
1121-
// Files payload?
1122-
if (loader && scene.sys.settings.hasOwnProperty('pack'))
1113+
else
11231114
{
1124-
loader.reset();
1115+
scene.sys.start(data);
11251116

1126-
if (loader.addPack({ payload: scene.sys.settings.pack }))
1117+
var loader;
1118+
1119+
if (scene.sys.load)
11271120
{
1128-
scene.sys.settings.status = CONST.LOADING;
1129-
1130-
loader.once('complete', this.payloadComplete, this);
1131-
1132-
loader.start();
1133-
1134-
return this;
1121+
loader = scene.sys.load;
1122+
}
1123+
1124+
// Files payload?
1125+
if (loader && scene.sys.settings.hasOwnProperty('pack'))
1126+
{
1127+
loader.reset();
1128+
1129+
if (loader.addPack({ payload: scene.sys.settings.pack }))
1130+
{
1131+
scene.sys.settings.status = CONST.LOADING;
1132+
1133+
loader.once('complete', this.payloadComplete, this);
1134+
1135+
loader.start();
1136+
1137+
return this;
1138+
}
11351139
}
11361140
}
11371141

0 commit comments

Comments
 (0)