@Lem wrote:
Hello!
I want to get my current running scene but I always get NULL, I have a scene and a NotificationNode above the scene. Can this be the problem?
Game2* gameScene = dynamic_cast<Game2*>(Director::getInstance()->getRunningScene());
I even desperately checked if maybe the type does not match (since then dynamic_cast returns NULL) so I checked other options like this:
Game2_Scene1Layer* test1 = dynamic_cast<Game2_Scene1Layer*>(Director::getInstance()->getRunningScene()); Game2_Scene1* test2 = dynamic_cast<Game2_Scene1*>(Director::getInstance()->getRunningScene()); ISceneLoader* test3 = dynamic_cast<ISceneLoader*>(Director::getInstance()->getRunningScene());
But here I also get NULL everywhere
Is there a way to get the type of the current running scene to I can cast it to the correct type?
Posts: 5
Participants: 2