这可以正常工作,但是当同时有多个联系人时,它不起作用。我该如何解决?
if (collision == (ballRightCategory | enemyCategory)) {
SKNode *node = contact.bodyA.node;
if (contact.bodyB.categoryBitMask == enemyCategory) {
node = contact.bodyB.node;
}
[[Sound sharedInstance] playSoundEffect:@"scoreSound.wav"];
[node removeFromParent];
[self gainScore];
}