【发布时间】:2021-01-17 12:49:24
【问题描述】:
我想检测与我的播放器节点冲突的节点名称。这可能吗?
func didBegin(_ contact: SKPhysicsContact) {
let collision: UInt32 = contact.bodyA.categoryBitMask | contact.bodyB.categoryBitMask
for i in CollectionObject {
if collision == Player.physicsBody!.categoryBitMask | i.physicsBody!.categoryBitMask{
print("hit the object") //here I would like to print the nodes name
}
}
}
【问题讨论】:
标签: swift sprite-kit skphysicsbody