开发者

Cocos2d - a way to get the current scene?

开发者 https://www.devze.com 2023-02-28 06:17 出处:网络
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.

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

0

精彩评论

暂无评论...
验证码 换一张
取 消