File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11var CHECKSUM = {
2- build : '6e590ff0-794e -11e7-8dad-3daa405d7eb2 '
2+ build : '3d87a5a0-7b8b -11e7-b495-ad4ce45c1958 '
33} ;
44module . exports = CHECKSUM ;
Original file line number Diff line number Diff line change @@ -70,13 +70,18 @@ var GameObject = new Class({
7070
7171 destroy : function ( )
7272 {
73- this . parent . remove ( this ) ;
73+ if ( this . parent )
74+ {
75+ this . parent . remove ( this ) ;
76+ }
7477
7578 if ( this . input )
7679 {
7780 this . scene . sys . inputManager . clear ( this ) ;
7881 }
7982
83+ this . active = false ;
84+
8085 this . scene = undefined ;
8186 }
8287
Original file line number Diff line number Diff line change @@ -69,26 +69,35 @@ var UpdateList = new Class({
6969 }
7070 } ,
7171
72- // Scene that owns this Clock is shutting down
73- shutdown : function ( )
72+ remove : function ( child )
7473 {
75- var i ;
74+ var index = this . _list . indexOf ( child ) ;
7675
77- for ( i = 0 ; i < this . _pendingInsertion . length ; i ++ )
76+ if ( index !== - 1 )
7877 {
79- this . _pendingInsertion [ i ] . destroy ( ) ;
78+ this . _list . splice ( index , 1 ) ;
8079 }
80+
81+ return child ;
82+ } ,
8183
82- for ( i = 0 ; i < this . _list . length ; i ++ )
83- {
84- this . _list [ i ] . destroy ( ) ;
85- }
84+ removeAll : function ( )
85+ {
86+ var i = this . _list . length ;
8687
87- for ( i = 0 ; i < this . _pendingRemoval . length ; i ++ )
88+ while ( i -- )
8889 {
89- this . _pendingRemoval [ i ] . destroy ( ) ;
90+ this . remove ( this . _list [ i ] ) ;
9091 }
9192
93+ return this ;
94+ } ,
95+
96+ // Scene that owns this Clock is shutting down
97+ shutdown : function ( )
98+ {
99+ this . removeAll ( ) ;
100+
92101 this . _list . length = 0 ;
93102 this . _pendingRemoval . length = 0 ;
94103 this . _pendingInsertion . length = 0 ;
You can’t perform that action at this time.
0 commit comments