【发布时间】:2016-12-06 06:29:47
【问题描述】:
我在将项目转换为 Swift 3 时遇到问题。在以前版本的 Swift 中,我可以在 GKComponentSystem 下声明一个类,例如:
class EnemyMoveComponentSystem: GKComponentSystem {
}
但是在 swift 3 中,它迫使我在最后添加 :
class EnemyMoveComponentSystem: GKComponentSystem <GKComponent> {
func updateWithDeltaTime(seconds: TimeInterval, gameScene: GameScene) {
for component in components {
print("something")
}
}
}
但我似乎无法像以前那样访问系统中的每个单独的组件
for component in components {
print("something")
}
print("something") 行从未被触发。 我怎样才能解决这个问题? 任何帮助表示赞赏!
【问题讨论】:
标签: xcode swift3 gameplay-kit