Skip to content

Commit 40818ba

Browse files
authored
Merge pull request phaserjs#3349 from migiyubi/make-scene-restartable
Make scene restartable
2 parents 278deda + decbe18 commit 40818ba

1 file changed

Lines changed: 8 additions & 11 deletions

File tree

src/scene/ScenePlugin.js

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -105,18 +105,15 @@ var ScenePlugin = new Class({
105105
{
106106
if (key === undefined) { key = this.key; }
107107

108-
if (key !== this.key)
108+
if (this.settings.status !== CONST.RUNNING)
109109
{
110-
if (this.settings.status !== CONST.RUNNING)
111-
{
112-
this.manager.queueOp('stop', this.key);
113-
this.manager.queueOp('start', key);
114-
}
115-
else
116-
{
117-
this.manager.stop(this.key);
118-
this.manager.start(key, data);
119-
}
110+
this.manager.queueOp('stop', this.key);
111+
this.manager.queueOp('start', key);
112+
}
113+
else
114+
{
115+
this.manager.stop(this.key);
116+
this.manager.start(key, data);
120117
}
121118

122119
return this;

0 commit comments

Comments
 (0)