Created
March 18, 2020 13:09
-
-
Save MickaelCruzDB/cceb6183e7fa022d319449a724cecb60 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@objc func goToMenu() { | |
if self.timerStarted == true { | |
self.idleTimer.invalidate() | |
self.timerStarted = false | |
} | |
self.ck3dCube.camera.stop() | |
self.scene.rootNode.enumerateChildNodes { (node, stop) in | |
node.geometry?.firstMaterial?.normal.contents = nil | |
node.geometry?.firstMaterial?.diffuse.contents = nil | |
node.geometry?.firstMaterial?.ambientOcclusion.contents = nil | |
node.geometry?.firstMaterial?.roughness.contents = nil | |
node.geometry?.firstMaterial?.metalness.contents = nil | |
node.geometry?.firstMaterial?.ambient.contents = nil | |
node.geometry?.materials.removeAll() | |
node.removeFromParentNode() | |
node.cleanup() | |
} | |
self.scene.rootNode.cleanup() | |
self.ck3dView.scene?.rootNode.cleanup() | |
self.ck3dCube.stop() | |
self.ck3dCube = nil | |
self.ck3dView.antialiasingMode = .none | |
self.ck3dView.scene = nil | |
self.ck3dView.removeFromSuperview() | |
self.ck3dView.stop(nil) | |
self.ck3dView = nil | |
self.scene = nil | |
let viewController = ViewController() | |
viewController.self.modalPresentationStyle = .fullScreen | |
viewController.self.modalTransitionStyle = .crossDissolve | |
viewController.transitioningDelegate = self as? UIViewControllerTransitioningDelegate | |
self.present(viewController, animated: true, completion: nil) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment