我试图在SKScene中添加一个动画SCNScene。在查看WWDC 2017届会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内容。
发布于 2018-03-03 12:56:36
弄明白了。
didMove不会被调用,因为当添加到diffuse.contents时它不在响应链中。
由于以这种方式添加SKScene时暂停,所以没有调用update。
https://stackoverflow.com/questions/48994144
复制相似问题