@@ -175,7 +175,6 @@ export default class ComponentClip {
175
175
}
176
176
177
177
set groupX ( val ) {
178
- //debugger;
179
178
if ( this . _groupConfig . x === val ) {
180
179
return ;
181
180
}
@@ -245,7 +244,7 @@ export default class ComponentClip {
245
244
return ;
246
245
}
247
246
this . _groupConfig . visible = val ;
248
- this . visible &= val ;
247
+ this . _stateManager . setupState ( ) ;
249
248
}
250
249
251
250
@@ -407,6 +406,17 @@ export default class ComponentClip {
407
406
return this . _stateManager . getActiveComponentByKey ( key ) ;
408
407
}
409
408
409
+ /**
410
+ * @public
411
+ * @method PhaserComps.ComponentClip#destroy
412
+ * @description destroy all child GameObjects and child clips recursively
413
+ */
414
+ destroy ( ) {
415
+ _ . each ( this . childrenList , child => {
416
+ child . destroy ( ) ;
417
+ } , this ) ;
418
+ }
419
+
410
420
/**
411
421
* @method PhaserComps.ComponentClip#_createImagesMap
412
422
* @description
@@ -789,7 +799,7 @@ class StateManager {
789
799
}
790
800
this . _currentStateId = stateId ;
791
801
this . _currentState = this . _states [ stateId ] ;
792
- this . _setupState ( ) ;
802
+ this . setupState ( ) ;
793
803
}
794
804
795
805
/**
@@ -816,10 +826,10 @@ class StateManager {
816
826
817
827
/**
818
828
* Show state components, apply its' state positions, and hide non-state components
819
- * @method PhaserComps.ComponentClip.tateManager#_setupState
820
- * @private
829
+ * @method PhaserComps.ComponentClip.tateManager#setupState
830
+ * @protected
821
831
*/
822
- _setupState ( ) {
832
+ setupState ( ) {
823
833
let idsToShow = this . _currentState . componentIds ;
824
834
let idsToHide = _ . difference ( this . _dynamicChildrenIds , idsToShow ) ;
825
835
0 commit comments