最近頻繁地用到了以下函數(shù)
enumerateChildNodes(withName: "http://*", using: { node, _ in
if let eventListenerNode = node as? EventListenerNode{
eventListenerNode.didMoveToScene()
}
其中用到了“//*”,看了相關(guān)解釋如下:
? /name: Search for nodes named “name” in the root of the hierarchy.
? //name: Search for nodes named “name” starting at the root and moving
recursively down the hierarchy.
- means any name
那么//*的意思就是從根目錄開始搜索所有樹形目錄的搜索文件
Mark