Created
August 18, 2022 09:57
-
-
Save wizard1066/c2b4b839f0bd8e61a94294d31d137647 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
if refresh { | |
morpher.targets = [cubeGeometry2,cubeGeometry] | |
cubeNode.morpher = morpher | |
SCNTransaction.begin() | |
SCNTransaction.animationDuration = 4.0 | |
cubeNode.morpher?.setWeight(1.0, forTargetAt: 0) | |
SCNTransaction.completionBlock = { | |
newNode = SCNNode(geometry: cubeGeometry2) | |
cubeNode.removeFromParentNode() | |
coreNode.addChildNode(newNode) | |
} | |
SCNTransaction.commit() | |
} else { | |
morpher.targets = [cubeGeometry] | |
newNode.morpher = morpher | |
SCNTransaction.begin() | |
SCNTransaction.animationDuration = 4.0 | |
newNode.morpher?.setWeight(1.0, forTargetAt: 0) | |
SCNTransaction.completionBlock = { | |
cubeNode = SCNNode(geometry: cubeGeometry) | |
newNode.removeFromParentNode() | |
coreNode.addChildNode(cubeNode) | |
} | |
SCNTransaction.commit() | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment