我使用下面的代码来运行动画,但是如何逆转动画呢?(例如,一个门模型有一个打开的动画,但我想让它关闭)
CC3ResourceNode* rezNode = [CC3PODResourceNode nodeFromFile: @"bd1hW1368.POD"];
[self addChild: rezNode];
CCActionInterval *stride = [CC3Animate actionWithDuration:10.0];
[rezNode runAction:[CCRepeatForever actionWithAction:stride]];更新
关于比尔的回答,我创建了一个连续的门关闭/打开动画如下:
CC3ResourceNode* rezNode = [CC3PODResourceNode nodeFromFile: @"bd1hW1368.POD"];
[self addChild: rezNode];
CC3Animate *stride = [CC3Animate actionWithDuration:10.0];
CC3Animate *reversedStride = [CC3Animate actionWithDuration:10.0];
reversedStride.isReversed = YES;
CCRepeatForever *repeat = [CCRepeatForever actionWithAction:[CCSequence actionWithArray:@[stride, reversedStride]]];
[rezNode runAction:repeat];发布于 2014-06-15 18:44:33
与大多数CCActionInterval子类一样,CC3Animate支持reverse方法,该方法返回配置为向后运行的新CC3Animate实例。
您还可以重用同一个CC3Animate实例,并将isReversed属性设置为YES,但是使用reverse方法创建单独的实例将使您能够更容易地执行类似于顺序打开门操作和关闭门操作的操作。
https://stackoverflow.com/questions/24226367
复制相似问题