当我的两个SKSpriteNodes触摸didBeginContact函数时,未调用:
func didBegin(_ contact: SKPhysicsContact) {
let bodyA = contact.bodyA
let bodyB = contact.bodyB
print("Called")
if bodyA.categoryBitMask == 1 && bodyB.categoryBitMask == 2 || bodyA.categoryBitMask == 2 && bodyB.categoryBitMask == 1{
//End
print("contact")
_ = GameScene4(fileNamed: "GameScene4.sks")
答案 0 :(得分:0)
如果你使用的是Xcode8.0 Swift3.0,你应该使用它。
func didBegin(_ contact: SKPhysicsContact) {}