I'm working on an iOS game that will require the use of both SceneKit & SpriteKit & was wondering about the Render/update loop function.
I will be using a SpawnController class to spawn different types of objects & they will be based on the time interval.
Right now I have a GameViewController that conforms to the SCNSceneRendererDelegate like here I've modified it so that inside the delegate update function I call my SpawnController's custom update function like so:
extension GameViewController: SCNSceneRendererDelegate {
func renderer(_ renderer: SCNSceneRenderer, updateAtTime time: TimeInterval) {
mySpawnController.nextSpawn()
}
}
I feel there must be a better way to do it such as add a delegate to an SCNScene or SCNNode.
My question:
Is it possible to have "update(_ currentTime: TimeInterval)" for SCNScene or SCNNode the same way as SKScene has? Or should I keep calling custom added update functions from the one SCNSceneRendererDelegate update function in my GameViewController?
Thanks