ios - 无法将 SKEffectNode 视为具有建议效果的 child

标签 ios xcode swift sprite-kit xcode7-beta6

我正在尝试调整一些效果,但我需要使用 SKEffectNode(),所以我编写了以下代码:

let rocketPath = NSBundle.mainBundle().pathForResource("Rocket", ofType: "sks")!
    let rocketFireEmitter = NSKeyedUnarchiver.unarchiveObjectWithFile(rocketPath) as! SKEmitterNode

    //playerNode.addChild(rocketFireEmitter)  // #1

    let firePathEffectMode = SKEffectNode()
    firePathEffectMode.shouldEnableEffects = true
    firePathEffectMode.addChild(rocketFireEmitter)

    playerNode.addChild(firePathEffectMode)   // #2

如果我使用标识为 #1 的代码(我已将其注释掉),则一切正常。 但我需要使用一些效果,所以我在#1和#2之间编写了代码块。我看不到火箭发射,但也没有收到任何错误。

我找不到问题;我尝试更改 zPosition 但无济于事。

我正在使用 Xcode 7 beta 6。 谢谢大家!

最佳答案

我向 Apple 提交了有关此错误的错误报告。

他们说最新版本的 El Capitan 测试版修复了 iOS 模拟器的问题。但是,我现在不推荐 Mac OS X 的测试版。

解决方法是在您的 iPhone 上运行它,而不是 iOS 模拟器。它应该可以在真实设备上运行。

Follow-Up: Bug ID 21509174: SKEffectNode doesn't render on the iOS Simulator for Xcode 7 and Swift 2

We believe this issue has been addressed in the latest OS X El Capitan 10.11 update (build 15A263e). This is a pre-release OS X update. Please refer to the release notes for complete installation instructions.

OS X Yosemite 10.11 - Developer beta https://developer.apple.com/devcenter/mac/index.action

关于ios - 无法将 SKEffectNode 视为具有建议效果的 child ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32374440/

相关文章:

ios - 如何在 SwiftUI 中使用幻灯片效果制作 subview 之间的过渡动​​画?

swift - OneSignal 和最新的 xcode : app does not ask for push notifications

ios - SWRevealViewController rightRevealToggle 无法在 Storyboard中使用 UIButton

ios - 如何在 UIDatePicker 中更改日期格式

c++ - NodeJS/iOS - 如何在使用 HTTP POST 调用后从二进制文件中获取返回值

android - 进入iOS和Android编程

ios - IOS 上的 WebRTC 媒体

ios - TableView 在数据加载之前出现

访问 NSUserDefaults 时,Release Build 会发生 Swift 崩溃

ios - Swift - 带自定义单元格和按钮的表格 View