CCAnimation *anim = [CCAnimation animationWithSpriteFrames:animFrames delay:reloadSpeed];
CCFiniteTimeAction *animFinite = [CCAnimate actionWithAnimation:anim];
CCRepeat *repeatAction = [CCRepeat actionWithAction:animFinite times:1];
id animDone = [CCCallFuncN actionWithTarget:self selector:@selector(doneAnimatingOnce)];
[self.person runAction:[CCSequence actions:repeatAction, animDone, nil]];
上面的代码永远不会到达函数“doneAnimatingOnce”,但下面的代码会,所以我觉得finiteTimeAction有问题
//CCFiniteTimeAction *animFinite = [CCAnimate actionWithAnimation:anim];
//CCRepeat *repeatAction = [CCRepeat actionWithAction:animFinite times:1];
id animDone = [CCCallFuncN actionWithTarget:self selector:@selector(doneAnimatingOnce)];
[self.person runAction:[CCSequence actions:animDone, nil]];
我想做的就是运行一次精灵表动画,但我已经为此苦苦挣扎了大约 4 个小时,有人可以帮忙吗?
CCFiniteTimeAction *animFinite = [CCAnimate actionWithAnimation:anim];
id animDone = [CCCallFunc actionWithTarget:self selector:@selector(doneAnimatingOnce)];
[self.person runAction:[CCSequence actionOne:animFinite two:animDone]];
运行动画但该函数仍然从未被调用