ios - 快速获取SKAction.repeat的循环索引
问题描述
我正在寻找一种方法来获取 SKAction.repeat 循环的循环索引。
在下面的代码中,我想用重复的索引替换“LOOP_INDEX”。
这甚至可能吗?
node.run(SKAction.sequence([
SKAction.run { node.physicsBody?.affectedByGravity = false },
// HERE
SKAction.repeat(SKAction.moveBy(x: 0, y: jumpHeight / CGFloat(sequences), duration: sequenceTimes[LOOP_INDEX]), count: sequences - 1),
SKAction.run { node.physicsBody?.affectedByGravity = true },
SKAction.moveBy(x: 0, y: jumpHeight / CGFloat(sequences), duration: sequenceTimes[2]),
]), withKey: "jump")
感谢您的回答;)
解决方案
推荐阅读
- php - 解析文件名,重命名文件,然后移动到另一个目录
- javascript - 在 componentDidMount 中设置状态时,React 应用程序不显示来自 api 的数据
- html - 选择小部件“折叠”下方的选项消失
- c - mov指令x86上的分段错误
- java - HTTP 状态 500 – 实例化 servlet 类 [NewServlet] 的内部服务器错误
- javascript - 在进度条上停止循环
- asp.net-core - openiddict-core refresh_token 使用遗留代码发布的令牌
- hive - 交叉连接剩余组合
- vue.js - Vuetify.js - `.container` 类在`npm run build` 后丢失样式
- python - 找不到如何从列表中打印