File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -540,7 +540,7 @@ var SceneManager = new Class({
540540 {
541541 var sys = this . scenes [ i ] . sys ;
542542
543- if ( sys . settings . status == = CONST . RUNNING )
543+ if ( sys . settings . status > CONST . START && sys . settings . status < = CONST . RUNNING )
544544 {
545545 sys . step ( time , delta ) ;
546546 }
@@ -617,6 +617,12 @@ var SceneManager = new Class({
617617 }
618618 }
619619
620+ // If the Scene has an update function we'll set it now, otherwise it'll remain as NOOP
621+ if ( scene . update )
622+ {
623+ sys . sceneUpdate = scene . update ;
624+ }
625+
620626 settings . status = CONST . RUNNING ;
621627 } ,
622628
@@ -660,11 +666,6 @@ var SceneManager = new Class({
660666
661667 newScene . sys . init ( this . game ) ;
662668
663- if ( ! newScene . update )
664- {
665- newScene . update = NOOP ;
666- }
667-
668669 return newScene ;
669670 }
670671 } ,
@@ -736,12 +737,6 @@ var SceneManager = new Class({
736737 {
737738 var sceneCallback = GetValue ( sceneConfig , defaults [ i ] , null ) ;
738739
739- // Must always have an update function, no matter what (the rest are optional)
740- if ( defaults [ i ] === 'update' && ! sceneCallback )
741- {
742- sceneCallback = NOOP ;
743- }
744-
745740 if ( sceneCallback )
746741 {
747742 newScene [ defaults [ i ] ] = sceneCallback ;
You can’t perform that action at this time.
0 commit comments