I'm removing and adding nodes using enumerateChildNodesWithName. I wondering if there is a way of using the enumerateChildNodesWithName with multiple names. For example, at the moment I am using the below:
nodeBase.enumerateChildNodesWithName("ground", usingBlock: {
node, stop in
if node.position.x + positionX < -self.frame.size.width/2 - sizeSegmentWidth/2 {
node.removeFromParent()
}
})
nodeBase.enumerateChildNodesWithName("obstacle", usingBlock: {
node, stop in
if node.position.x + positionX < -self.frame.size.width/2 - sizeSegmentWidth/2 {
node.removeFromParent()
}
})
But what I'm hoping to do is something like this (this doesn't work, just an example of what I'm trying to do):
nodeBase.enumerateChildNodesWithName("ground" || "obstacle", usingBlock: {
node, stop in
if node.position.x + positionX < -self.frame.size.width/2 - sizeSegmentWidth/2 {
node.removeFromParent()
}
})