gpt4 book ai didi

ios - 在切换到新场景之前,Sprite 套件无法运行 Action

转载 作者:行者123 更新时间:2023-11-28 20:04:10 24 4
gpt4 key购买 nike

操作不在此代码中运行:

 SKAction *moveLeft = [SKAction moveToX:(-800) duration:0.6];
SKAction *moveRight = [SKAction moveToX:(800) duration:0.6];
[_labelLogo runAction:moveLeft];
[_labelPlay runAction:moveRight];

NewYork *start = [[NewYork alloc] initWithSize:self.size];
SKTransition *reveal = [SKTransition fadeWithColor:[UIColor clearColor] duration:2];
reveal.pausesIncomingScene = NO;

[self.scene.view presentScene: start transition: reveal];

如果我评论 NewYork switching 它们会起作用。

最佳答案

action *moveLeft/*moveRight 的问题,因为立即开始转换到 NewYork 场景,所以你应该等待 *moveLeft/*moveRight 完成,如下所示:

 SKAction *moveLeft = [SKAction moveToX:(-800) duration:0.6];
SKAction *moveRight = [SKAction moveToX:(800) duration:0.6];
[_labelLogo runAction:moveLeft];

[_labelPlay runAction:moveRight completion:^{

NewYork *start = [[NewYork alloc] initWithSize:self.size];
SKTransition *reveal = [SKTransition fadeWithColor:[UIColor clearColor] duration:2];
reveal.pausesIncomingScene = NO;

[self.view presentScene:start transition:reveal];
}];

关于ios - 在切换到新场景之前,Sprite 套件无法运行 Action ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22664741/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com