如何让弹出的其他场景知道 popscene 事件?另一个场景又回到了视野中,但现在我想要发生一些事情,但我不知道触发它的最佳方式。
最佳答案
您可以使用CCNode的onEnter、onEnterTransitionDidFinish或onExit方法。在从 CCScene 派生的类中实现您想了解的方法。
- (void)onEnter
{
[super onEnter];
/*
* This method is called every time the CCNode enters the 'stage'.
*/
}
- (void)onEnterTransitionDidFinish
{
[super onEnterTransitionDidFinish];
/*
* This method is called when the transition finishes.
*/
}
- (void)onExit
{
[super onExit];
/*
* This method is called every time the CCNode leaves the 'stage'.
*/
}
关于iphone - cocos2d 流行场景事件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6119332/