我正在尝试将一个动画SKScene添加到ARKit中的SCNScene。在查看WWDC 2017 session 609这似乎是可能的。在演示文稿中,代码看起来像这样......
//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)
我可以做的事情:
我不能做的事情:
不确定我错过了什么。本季节的主持人展示了动画和互动的SK内容。
想出这个。
didMove没有被调用,因为它在添加到diffuse.contents时不在响应者链中。
更新未被调用,因为SKScene在以这种方式添加时暂停。