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?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…