We are migrating issue tracker of Cocos2d-x Project to Github, please create new issue there. Thanks.
[JSB] onEnter order is wrong
[JSB] onEnter order is wrong
Bug #3290 [Closed]
We are migrating issue tracker of Cocos2d-x Project to Github, please create new issue there. Thanks.
This bug was reported by an email from a game developer.
The email contents are:
Recently, we’re developing a JSB game named 《一二三国》, we found a bug in Node.
Reproduce Step:¶
If there is a node tree like the following:
B and C are the children of A.
If A, B and C have implemented cc.Node.onEnter and they were added to scene graph,
In the implementation of cocos2d-x C++, the order of
onEnter
is: A~~>B~~>C which is also the same as cocos2d-html5.But in JSB, the order is changed to B~~>C~~>A, this will cause compatibility issues between JSB and Html5.
The reason of this issue is:
Since the executed order of
ScripEngineManager::executeXXX
is after arrayMakeObjectPerformSelector, It will cause the order ofonEnter
in JSB is B~~>C~~>A.Solution:¶
We should move
ScripEngineManager::executeXXX
at the beginning.