Update: CC - Demo New - Entity Loaded (tuby5lj4di.js) 309 bytes modified

beta.r3js.org
-=yb4f310 2018-02-16 11:22:56 +01:00
parent 290bdf6ed1
commit 393e5bdc62
1 changed files with 52 additions and 26 deletions

View File

@ -1,33 +1,54 @@
if (this.parentEntity === data.entity) {
console.log('Entity FSDemo Loaded');
this.imageSpoon = GameLib.EntityManager.Instance.findComponentById('g6oggbsg5k');
this.imageEarth = GameLib.EntityManager.Instance.findComponentById('fo1einfper');
this.meshBox = GameLib.EntityManager.Instance.findComponentById('2ehdod2g2a');
this.meshImageGrid = GameLib.EntityManager.Instance.findComponentById('9qkka13nor');
this.instancedGeometry = GameLib.EntityManager.Instance.findComponentById('s5dfh75zza');
this.boxGeometry = GameLib.EntityManager.Instance.findComponentById('pwzyukkviy');
/**
* Textures
*/
this.textureWhite = GameLib.EntityManager.Instance.findComponentById('642tyh30uo');
/**
* Materials
*/
this.materialRawPhong = GameLib.EntityManager.Instance.findComponentById('r153c4450d');
this.ccBeforeRender = GameLib.EntityManager.Instance.findComponentById('wlw063ovw9');
this.ccKeyUp = GameLib.EntityManager.Instance.findComponentById('ip0443a52d');
this.ccBeforeRender.entityLoaded = this;
this.ccKeyUp.entityLoaded = this;
} else {
return;
}
/**
* Images
*/
this.imageSpoon = GameLib.EntityManager.Instance.findComponentById('g6oggbsg5k');
this.imageEarth = GameLib.EntityManager.Instance.findComponentById('fo1einfper');
this.images = [
this.imageSpoon,
this.imageEarth
];
/**
* Meshes
*/
this.meshBox = GameLib.EntityManager.Instance.findComponentById('2ehdod2g2a');
this.meshImageGrid = GameLib.EntityManager.Instance.findComponentById('9qkka13nor');
/**
* Geometry
*/
this.instancedGeometry = GameLib.EntityManager.Instance.findComponentById('s5dfh75zza');
this.boxGeometry = GameLib.EntityManager.Instance.findComponentById('pwzyukkviy');
/**
* Textures
*/
this.textureWhite = GameLib.EntityManager.Instance.findComponentById('642tyh30uo');
/**
* Materials
*/
this.materialRawPhong = GameLib.EntityManager.Instance.findComponentById('r153c4450d');
/**
* Custom Code Components
*/
this.ccBeforeRender = GameLib.EntityManager.Instance.findComponentById('wlw063ovw9');
this.ccKeyUp = GameLib.EntityManager.Instance.findComponentById('ip0443a52d');
this.ccBeforeRender.entityLoaded = this;
this.ccKeyUp.entityLoaded = this;
/**
* Generates new Attribute Data based on the image index according to 'width' and 'height'
*/
GameLib.CustomCode.prototype.generateAttributeData = function(index, width, height) {
var heightData = this.images[this.currentImageIndex].getHeightData();
@ -56,6 +77,9 @@ GameLib.CustomCode.prototype.generateAttributeData = function(index, width, heig
}.bind(this);
/**
* Builds our instanced geometry
*/
GameLib.CustomCode.prototype.buildInstancedGeometry = function(index) {
var attributeData = this.generateAttributeData(index, 128, 128);
@ -103,4 +127,6 @@ GameLib.CustomCode.prototype.buildInstancedGeometry = function(index) {
}.bind(this);
this.buildInstancedGeometry(0);
//@ sourceURL=entiyuLoaded.js