diff --git a/cocos2dx/layers_scenes_transitions_nodes/CCLayer.cpp b/cocos2dx/layers_scenes_transitions_nodes/CCLayer.cpp index 8416ae57f1..c00cf03903 100644 --- a/cocos2dx/layers_scenes_transitions_nodes/CCLayer.cpp +++ b/cocos2dx/layers_scenes_transitions_nodes/CCLayer.cpp @@ -1073,6 +1073,19 @@ void LayerMultiplex::addLayer(Layer* layer) _layers->addObject(layer); } +bool LayerMultiplex::init() +{ + if (Layer::init()) + { + _layers = Array::create(); + _layers->retain(); + + _enabledLayer = 0; + return true; + } + return false; +} + bool LayerMultiplex::initWithLayers(Layer *layer, va_list params) { if (Layer::init()) diff --git a/cocos2dx/layers_scenes_transitions_nodes/CCLayer.h b/cocos2dx/layers_scenes_transitions_nodes/CCLayer.h index 24df564cba..32e8991b75 100644 --- a/cocos2dx/layers_scenes_transitions_nodes/CCLayer.h +++ b/cocos2dx/layers_scenes_transitions_nodes/CCLayer.h @@ -374,6 +374,7 @@ public: LayerMultiplex(); virtual ~LayerMultiplex(); + virtual bool init(); /** initializes a MultiplexLayer with one or more layers using a variable argument list. */ bool initWithLayers(Layer* layer, va_list params);