【问题标题】:Select child's child in swift 3 [closed]在swift 3中选择孩子的孩子[关闭]
【发布时间】:2017-08-28 19:53:58
【问题描述】:

我想像这样选择一个孩子的孩子:

var button = childNode(withName: "button") as! SKSpriteNode

SKSpriteNode“警报”内有SKSpriteNode“按钮”

【问题讨论】:

    标签: swift swift3 sprite-kit children


    【解决方案1】:

    在选择子使用时childNode(withName: "button") 987654322 @ self是您在(或场景)中的任何类。要调用对象的子对象,请使用...

    let alert = self.childNode(withName: "alert") as! SKSpriteNode
    var button = alert.childNode(withName: "button") as! SKSpriteNode
    

    【讨论】:

      猜你喜欢
      • 2012-12-13
      • 1970-01-01
      • 1970-01-01
      • 2023-03-20
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-11-21
      • 1970-01-01
      相关资源
      最近更新 更多