From 1cdf99ecd6612e99735127d14e554553459402e4 Mon Sep 17 00:00:00 2001 From: -=yb4f310 Date: Fri, 16 Feb 2018 12:26:43 +0100 Subject: [PATCH] Update: CC - Demo New - Entity Loaded (tuby5lj4di.js) 371 bytes modified --- tuby5lj4di.js | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) 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;