This commit is contained in:
halx99 2020-11-17 21:57:35 +08:00
parent ad36cdabdb
commit f6e87217bf
1 changed files with 3 additions and 1 deletions

View File

@ -121,7 +121,9 @@ void Control::sendActionsForControlEvents(EventType controlEvents)
#if CC_ENABLE_SCRIPT_BINDING
cocos2d::BasicScriptData data(this,(void*)&controlEvents);
cocos2d::ScriptEvent event(cocos2d::kControlEvent,(void*)&data);
cocos2d::ScriptEngineManager::getInstance()->getScriptEngine()->sendEvent(event);
auto scriptEngine = cocos2d::ScriptEngineManager::getInstance()->getScriptEngine();
if(scriptEngine)
scriptEngine->sendEvent(event);
#endif
}
}