3

I use cocos2d-x 3.0 RC1, and I have the following question. As I knew, cocos2d-x had a single (centralized) event dispatcher, and it was implemented as a singleton so that I could send event from everywhere to anywhere. Now in the final version it is not a singleton and I cannot use EventDispatcher::getInstance(). Why the centralized EventDispatcher was considered wrong? In this case how I can send an event from a class that is not a cocos2d::Node to another class that is not a cocos2d::Node either?

4

1 回答 1

9

得到了答案:

cocos2d::Director::getInstance()->getEventDispatcher();
于 2014-04-23T09:42:33.447 回答