@@ -192,9 +192,9 @@ export default class ComponentClip extends Phaser.GameObjects.Container {
192
192
* @param {Boolean } [fromScene=false]
193
193
*/
194
194
destroy ( fromScene ) {
195
- _ . each ( this . childComponentClips , child => {
195
+ for ( let child of this . childComponentClips ) {
196
196
child . destroy ( fromScene ) ;
197
- } , this ) ;
197
+ }
198
198
super . destroy ( fromScene )
199
199
}
200
200
@@ -208,16 +208,16 @@ export default class ComponentClip extends Phaser.GameObjects.Container {
208
208
* @ignore
209
209
*/
210
210
_createImagesMap ( textures ) {
211
- _ . each ( textures , ( textureName ) => {
211
+ for ( let textureName of textures ) {
212
212
const texture = this . scene . textures . get ( textureName ) ;
213
213
if ( ! texture ) {
214
214
return ;
215
215
}
216
216
const frames = texture . getFrameNames ( ) ;
217
- _ . each ( frames , ( frameName ) => {
217
+ for ( let frameName of frames ) {
218
218
this . imageFramesMap [ frameName ] = textureName ;
219
- } , this ) ;
220
- } , this ) ;
219
+ }
220
+ }
221
221
}
222
222
223
223
/**
@@ -230,9 +230,9 @@ export default class ComponentClip extends Phaser.GameObjects.Container {
230
230
_parseConfig ( ) {
231
231
//ComponentView._setupCommonParams(this, this._config);
232
232
if ( this . _config . hasOwnProperty ( "children" ) ) {
233
- _ . each ( this . _config . children , ( childConfig ) => {
233
+ for ( let childConfig of this . _config . children ) {
234
234
this . _createChildFromConfig ( childConfig ) ;
235
- } , this ) ;
235
+ }
236
236
}
237
237
}
238
238
@@ -263,10 +263,10 @@ export default class ComponentClip extends Phaser.GameObjects.Container {
263
263
child = this . _createPolygonFromConfig ( config ) ;
264
264
if ( config . hasOwnProperty ( "masking" ) ) {
265
265
let mask = child . createGeometryMask ( ) ;
266
- _ . each ( config . masking , ( maskedChildId ) => {
266
+ for ( let maskedChildId of config . masking ) {
267
267
let maskedChild = this . _childrenById [ maskedChildId ] ;
268
268
maskedChild . setMask ( mask ) ;
269
- } , this ) ;
269
+ }
270
270
addAsChild = false ;
271
271
}
272
272
}
@@ -599,15 +599,14 @@ class StateManager {
599
599
setupState ( ) {
600
600
let idsToShow = this . _currentState . componentIds ;
601
601
let idsToHide = _ . difference ( this . _dynamicChildrenIds , idsToShow ) ;
602
-
603
- _ . each ( idsToHide , ( id ) => {
602
+ let id ;
603
+ for ( id of idsToHide ) {
604
604
this . _components [ id ] . visible = false ;
605
- } , this ) ;
606
-
607
- _ . each ( idsToShow , ( id ) => {
605
+ }
606
+ for ( id of idsToShow ) {
608
607
let component = this . _components [ id ] ;
609
608
component . visible = true ;
610
609
ComponentClip . _setupCommonParams ( component , this . _currentState . config [ id ] ) ;
611
- } , this ) ;
610
+ }
612
611
}
613
612
}
0 commit comments