diff --git a/tuby5lj4di.js b/tuby5lj4di.js index e73ed57..7aec567 100644 --- a/tuby5lj4di.js +++ b/tuby5lj4di.js @@ -53,6 +53,8 @@ this.keyUp = GameLib.EntityManager.Instance.findComponentById('ip0443a52d'); */ this.attributeData = null; this.updateInformation = []; +this.currentIndex = 0; +this.maxIndex = this.images.length - 1; /** * Attributes @@ -194,6 +196,22 @@ GameLib.CustomCode.prototype.updateAttributeArrays = function(alpha) { console.log('animation : ' + alpha); }.bind(this); +/** + * Load the next animation + */ +GameLib.CustomCode.prototype.loadNext = function() { + + this.currentIndex++ + + if (this.currentIndex > this.maxIndex) { + this.currentIndex = 0; + }; + + var attributeData = this.generateAttributeData(this.currentIndex, 128, 128); + + this.startAnimation(attributeData); +} + this.buildInstancedGeometry(0); this.beforeRender.entityLoaded = this;