CCLayer::~CCLayer() { #if ND_MOD DEC_CCOBJ("CCLayer"); #endif unregisterScriptTouchHandler(); }
void CCLayer::onExit() { if( m_bIsTouchEnabled ) { CCTouchDispatcher::sharedDispatcher()->removeDelegate(this); unregisterScriptTouchHandler(); } // remove this layer from the delegates who concern Accelerometer Sensor if (m_bIsAccelerometerEnabled) { CCAccelerometer::sharedAccelerometer()->setDelegate(NULL); } // remove this layer from the delegates who concern the kaypad msg if (m_bIsKeypadEnabled) { CCKeypadDispatcher::sharedDispatcher()->removeDelegate(this); } CCNode::onExit(); }
CCLayer::~CCLayer() { unregisterScriptTouchHandler(); unregisterScriptKeypadHandler(); unregisterScriptAccelerateHandler(); }
void CCLayer::registerScriptTouchHandler(int nHandler, bool bIsMultiTouches, int nPriority, bool bSwallowsTouches) { unregisterScriptTouchHandler(); m_pScriptTouchHandlerEntry = CCTouchScriptHandlerEntry::create(nHandler, bIsMultiTouches, nPriority, bSwallowsTouches); m_pScriptTouchHandlerEntry->retain(); }
CCLayer::~CCLayer() { unregisterScriptTouchHandler(); }
void CCLayer::registerScriptTouchHandler(ccScriptFunction nHandler) { unregisterScriptTouchHandler(); m_pScriptTouchHandlerEntry = CCTouchScriptHandlerEntry::create(nHandler); CC_SAFE_RETAIN(m_pScriptTouchHandlerEntry); }