lars Posted April 6, 2018 Share Posted April 6, 2018 Hello Anyone knows how to check if a Spine animation is complete. Tried: player.onComplete(); Quote Link to comment Share on other sites More sharing options...
enpu Posted April 6, 2018 Share Posted April 6, 2018 @lars Try this: player.state.addListener({ complete: function(entry) { } }); Quote Link to comment Share on other sites More sharing options...
enpu Posted April 6, 2018 Share Posted April 6, 2018 Here is full example of Spine events: game.createScene('Events', { init: function() { var player = new game.Spine('spineboy.json'); player.position.x = game.width / 2; player.position.y = game.height - 100; player.state.addListener({ start: this.start.bind(this), complete: this.complete.bind(this), event: this.event.bind(this) }); player.play('run', true); player.addTo(this.stage); }, start: function(entry) { console.log('Animation started'); }, complete: function(entry) { console.log('Animation completed'); }, event: function(entry, event) { // User-defined event console.log(event.data.name); } }); More info about Spine events: http://esotericsoftware.com/spine-unity-events Ninjadoodle 1 Quote Link to comment Share on other sites More sharing options...
lars Posted April 6, 2018 Author Share Posted April 6, 2018 Thank´s a lot Enpu. Was actually looking in the Spine doc. But did´nt find it ... sorry :-) Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.