I am attempting to add an animated SKScene to SCNScene inside ARKit. Upon viewing WWDC 2017 session 609 this seems possible. In the presentation the code looks like this...
//Get SpriteKit scene
let spriteKitScene = SKScene(fileNamed: "SpriteKitScene")
//Create plane geometry
let plane = SCNPlane(width: 10.0, height: 10.0)
//Set SpriteKit scene on the plane's material
plane.firstMaterial?.diffuse.contents = spriteKitScene
//If material double-sided, SpriteKit scene will show up on both sides of the plane
plane.firstMaterial?.isDoubleSided = true
//Create a SceneKit node for the plane
let sceneKitNode = SCNNode(geometry: plane)
//Add the Scenekit node to the SceneKit scene
scene.rootNode.addChildNode(sceneKitNode)
Things I can do:
Things I can't do:
Not sure what I am missing. The presenter in the season shows animated and interactive SK content.
答案 0 :(得分:0)
想出来了。
didMove没有被调用,因为当它被添加到diffuse.contents时它不在响应者链中。
更新未被调用,因为以这种方式添加SKScene时会暂停。