下面我的代码中的 delayperunit 属性在精灵改变之前保持屏幕上的 2.5 秒。我真正想做的是将精灵显示 0.5 秒,以便在下一个出现 0.5 秒之前有 2.0 秒的中断(不显示动画),依此类推。我怎样才能做到这一点?
// Create the intro image
CGSize screenSize = [CCDirector sharedDirector].winSize;
CCSprite *introImage = [CCSprite spriteWithFile:@"intro1.png"];
[introImage setPosition:ccp(screenSize.width/2, screenSize.height/2)];
[self addChild:introImage];
// Create the intro animation, and load it from intro1 to intro7.png
CCAnimation *introAnimation = [CCAnimation animation];
[introAnimation delayPerUnit:2.5f];
for (int frameNumber=0; frameNumber < 8; frameNumber++) {
CCLOG(@"Adding image intro%d.png to the introAnimation.",frameNumber);
[introAnimation addSpriteFrameWithFilename:
[NSString stringWithFormat:@"intro%d.png",frameNumber]];
}