Created
March 13, 2019 08:11
-
-
Save goooooouwa/a240a57208306c5ccc2fa47f09054923 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
var anim = this.node.getChildByName("flashLight").getComponent(cc.Animation); | |
// these 3 steps must in order to play and pause the animation at 0.5s | |
anim.setCurrentTime(0.5, 'flashLight'); | |
anim.play("flashLight"); | |
anim.pause('flashLight'); | |
this.render().then(() => { | |
// these 2 steps must in order to resume the animation from 0.5s | |
anim.setCurrentTime(0.5, 'flashLight'); | |
anim.resume("flashLight"); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment