Cocos2d - a way to get the current scene?
I'm looking for a way to get the current scene so that I'll be able to tell which scene is running at any开发者_高级运维 time.
Thanks!
Check out CCDirector
. You can get the running scene like this:
[[CCDirector sharedDirector] runningScene];
From the documentation of cocos2D:
-(CCScene*) runningScene [read, assign]
The current running Scene. Director can only run one Scene at the time
Sandro Meier
精彩评论