NSTimer vs SKAction(性能)

时间:2015-04-27 08:16:46

标签: ios performance nstimer skaction

我对SpriteKit和游戏开发有点新鲜 我的问题是如何使用SKAction更好:

SKAction * shelvesAction = [SKAction performSelector:@selector(makeShelves) onTarget:self];
SKAction * delayAction = [SKAction waitForDuration:1];
SKAction * runShelvesForever = [SKAction repeatActionForever:[SKAction sequence:@[delayAction,shelvesAction]]];
[self runAction:runShelvesForever withKey:@"shelvesAction"];

或者只是一个NSTimer

_shevesTimer = [NSTimer scheduledTimerWithTimeInterval:1 target:self selector:@selector(makeShelves) userInfo:nil repeats:YES];

哪一个更快,有什么不同?

0 个答案:

没有答案