gpt4 book ai didi

swift - 具有动态 timePerFrame 的 SKAction.animateWithTextures

转载 作者:行者123 更新时间:2023-11-30 14:10:17 24 4
gpt4 key购买 nike

我希望我的英雄能够动态改变运行速度,我试图找出我在这里做错了什么: enter image description here

谢谢

最佳答案

如果您查看documentation for SKAction您可以看到 timePerFrame 的类型是 NSTimeInterval (Double 的类型别名)。因此,您只需将 val 的类型更改为 NSTimeInterval:

private func run(val: NSTimeInterval) {
// ...
}
<小时/>

您可能还对 speed property on SKNode 感兴趣,它可用于更改节点正在执行的任何 SKAction 的速度。

关于swift - 具有动态 timePerFrame 的 SKAction.animateWithTextures,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31854842/

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