Projects > cpp > Issues > Bug #4072

We are migrating issue tracker of Cocos2d-x Project to Github, please create new issue there. Thanks.

Create Issue on Github

onEnterTransitionDidFinish and getRunningScene

Bug #4072 [Closed]
Auhuro 2014-02-19 07:51 . Updated about 2 years ago

When scene receives onEnterTransitionDidFinish() Director::getRunningScene() returns transition scene BUT not scene that was wrapped.
Current behavior is scene receive onEnterTransitionDidFinish in onExit of Transition, when transition is not finished and runningScene has not been updated yet.

Suggested fix:

--- a/cocos/2d/CCDirector.cpp
+++ b/cocos/2d/CCDirector.cpp
@@ -773,9 +773,12 @@ void Director::setNextScene()
_nextScene->retain();
_nextScene = nullptr;

  • if ((! runningIsTransition) && _runningScene)
  • if (_runningScene) {
  • _runningScene->onEnter();
  • if (!runningIsTransition)
  • {
  • _runningScene->onEnter();
  • } _runningScene->onEnterTransitionDidFinish(); } }

--- a/cocos/2d/CCTransition.cpp
+++ b/cocos/2d/CCTransition.cpp
@@ -180,7 +180,7 @@ void TransitionScene::onExit()

 // _inScene should not receive the onEnter callback
 // only the onEnterTransitionDidFinish
  • _inScene->onEnterTransitionDidFinish();
    +// _inScene->onEnterTransitionDidFinish();
    }

    // custom cleanup

Auhuro 2014-02-19 07:56

Is Duplicate of Bug #4073, please remove this one

walzer@cocos2d-x.org 2014-10-08 02:59

Redmine issue system is closed, we are using github issue system instead.

This issue was moved to https://github.com/cocos2d/cocos2d-x/issues/8348

Atom PDF

Status:Closed
Start date:2014-02-19
Priority:Low
Due date:
Assignee:-
% Done:

0%

Category:all
Target version:-

Sign up for our newsletter to keep up with the latest developments, releases and updates for Cocos2d-x.