Sign in to follow this  
lars

Check if a Spine animation is complete

Recommended Posts

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

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.