SKNode 有 actions 属性吗?
我想知道是否有一种简单的方法可以查看当前分配给 SpriteKit 中节点的所有操作的列表。类似于“actions
”属性,它将包含所有节点操作的列表。 SKNode 的文档 没有显示类似的内容。
但是,我在 Xcode 调试器中放置了一个断点,发现我的 SKNode
上确实有一个 actions
属性:
您可以在调试器中看到这actions
数组包含在我的节点上运行的两个操作。但奇怪的是,如果我尝试在代码中访问该属性,则会收到错误:
let node = self as SKNode
print(node.actions)
// Value of type 'SKNode' has no member 'actions'
谁能告诉我 SKNode
上的这个 actions
属性来自哪里?为什么我们可以在调试器中看到它但无法在代码中访问它?
I wondered if there was an easy way to see a list of all actions currently assigned to a node in SpriteKit. Something like an "actions
" property that will contain a list of all a node's actions. The documentation for SKNode does not show anything like this.
However, I put a breakpoint in the Xcode debugger and saw that indeed there was an actions
property on my SKNode
:
You can see in the debugger that this actions
array contains two actions that are running on my node. But strangely, if I try to access that property in code I get an error:
let node = self as SKNode
print(node.actions)
// Value of type 'SKNode' has no member 'actions'
Can anyone tell me where this actions
property on the SKNode
is coming from? Why can we see it in the debugger but cannot access it in code?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论