1
我目前正在使用cocos2d導演來控制我的動畫,使用pause
,resume
和stopAnimation
方法。是否也可以使用導演返回動畫播放的時間?cocos2d導演可以返回時間嗎?
我目前使用這種方法:
-(void)stopAnimation:(id)sender {
//Timer initialized elsewhere: startTimer = [NSDate timeIntervalSinceReferenceDate];
//Do other method stuff here
[[Director sharedDirector] stopAnimation];
stopTimer = [NSDate timeIntervalSinceReferenceDate];
elapsedTime = (stopTimer - startTimer);
NSLog(@"elapsedTime = %f", elapsedTime);
}