0
我在我的第一个场景的重复动作,我想为用户触摸屏幕的首次尽快停止。是否有可能在didMoveToView
中检测到触摸?我不能使用touchesBegan
,因为这是唯一的第一个触摸一个特殊情况,我不希望它重复每一个触摸。如何在didMoveToView(Swift,SpriteKit)中注册touch?
override func didMoveToView(view: SKView) {
triangle.position = CGPoint(x: self.frame.width/2, y: self.frame.height/2)
self.addChild(triangle)
triangle.runAction(SKAction.repeatActionForever(rotateAction))
//->This is where I need to detect a touch
}