I have an SKNode with a number of child SKSpriteNodes. A simplified example:
var parentNode = SKNode()
var childNode1 = SKSpriteNode()
var childNode2 = SKSpriteNode()
self.addChild(parentNode)
parentNode.addChild(childNode1)
parentNode.addChild(childNode2)
I want to run a colorizeWithColor
action on all of these children. When I run the action on parentNode
, there's no effect.
I can't use enumerateChildNodesWithName
on the parent, because many of its children already have names I'm using.
Is there a way of looping through all children of parentNode
, in order to run a single action on all of them?