4
我希望有人能夠幫助我解決這個問題。我似乎無法找到一種方法爲removeActionWithKey方法的Sprite Kit的SKAction分配一個鍵。我也嘗試將操作分配給字典中的某個鍵,但該程序沒有識別出鍵值,因此返回了零值。如何在Swift中將鍵分配給SKActions
這裏是我試圖做的:
var textureanimation = SKAction.repeatActionForever(SKAction.animateWithTextures(_walkingframes, timePerFrame: 0.1))
var dictionary = ["animation": textureanimation]
object.runAction(actionForKey("animation"))
var sequence = [SKAction.moveTo(tap_position, duration: time_duration),
SKAction.runBlock{
object.removeActionForKey("animation")}