Created
October 11, 2015 15:02
-
-
Save joseph-montanez/e4bd676beb0487c2bf36 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
var zoomInOutComp = node.addComponent({ | |
onUpdate: function (time) { | |
// console.trace(); | |
if (_SceneTwo.paused) { | |
//-- The scene us paused | |
trans.pause(); | |
} else { | |
//-- The scene is not pause | |
if (trans.isPaused()) { | |
//-- the scene was unpaused, so we should | |
trans.resume(); | |
} else { | |
var params = trans.get(); | |
node.setPosition(params[0], params[1], params[2]); | |
node.setScale(params[3], params[4], params[5]); | |
} | |
} | |
if (trans.isActive()) { | |
//-- As long as the Transitional is active, keep updating | |
node.requestUpdate(zoomInOutComp); | |
} | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment