【问题标题】:Waiting 3 sec before running sprite kit scene在运行 sprite kit 场景之前等待 3 秒
【发布时间】:2014-03-14 15:47:13
【问题描述】:

我有一个 sprite kit 场景,其中敌人被随机派出,玩家必须摧毁它们。但是我想在它们开始产卵之前等待 3 秒钟。我试过了

    -(id)initWithSize:(CGSize)size {    
if (self = [super initWithSize:size]) {
    /* Setup your scene here */

    //Set the init variables.
    //AudioServicesPlaySystemSound (kSystemSoundID_Vibrate);

    SKAction *wait = [SKAction waitForDuration:3];
    [self runAction:wait];}

这不起作用,我做错了什么?

【问题讨论】:

    标签: sprite sprite-kit nstimeinterval skaction


    【解决方案1】:

    使用补全。

    [self runAction:wait completion:^
    { [self startSpawning] }];
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-09-27
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多