cocos2d popscene事件

时间:2011-05-25 03:50:16

标签: iphone objective-c cocos2d-iphone

如何让弹出的其他场景知道popscene事件?另一个场景又回到视野中,但现在我想要发生一些事情,我无法找出触发它的最佳方式。

1 个答案:

答案 0 :(得分:3)

您可以使用onEnter,onEnterTransitionDidFinish或CCNode的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'.
     */
}