Created
January 26, 2015 14:35
-
-
Save veeneck/9ae95b8d4b59280f916d to your computer and use it in GitHub Desktop.
Class timing
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
class CutsceneAction { | |
var finishEarly : Bool = false | |
func timingFunc(time:Float) -> Float { | |
if(self.finishEarly) { | |
return 1.0 | |
} | |
else { | |
return time | |
} | |
} | |
func runAction(object:SKNode, action:SKAction) { | |
action.timingFunction = self.timingFunc | |
object.runAction(action) | |
} | |
/// Call this on touch, or for any other reason, from scene | |
func skip() { | |
self.finishEarly = true | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment