开发者

Calling method at the end of sprite animation in cocos2d

开发者 https://www.devze.com 2023-03-29 06:04 出处:网络
Can 开发者_运维技巧anybody tell me how to call a method at the end of the sprite animation. I want the last image to be removed from the scene. Thats why i want to call that method.

Can 开发者_运维技巧anybody tell me how to call a method at the end of the sprite animation. I want the last image to be removed from the scene. Thats why i want to call that method. If there is any better way to do that please tell me.


Add this to the end of your CCSequence:

CCCallFuncO* removeMe = [CCCallFuncO actionWithTarget:self selector:@selector(removeMe:) object:variableOfObjectToRemove];

Then:

- (void) removeMe:(id)object {
//remove
}
0

精彩评论

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