Update: CC - Demo New - Entity Loaded (tuby5lj4di.js) 309 bytes modified
parent
290bdf6ed1
commit
393e5bdc62
|
@ -1,33 +1,54 @@
|
||||||
if (this.parentEntity === data.entity) {
|
if (this.parentEntity === data.entity) {
|
||||||
|
|
||||||
console.log('Entity FSDemo Loaded');
|
console.log('Entity FSDemo Loaded');
|
||||||
|
} else {
|
||||||
this.imageSpoon = GameLib.EntityManager.Instance.findComponentById('g6oggbsg5k');
|
return;
|
||||||
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;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 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) {
|
GameLib.CustomCode.prototype.generateAttributeData = function(index, width, height) {
|
||||||
|
|
||||||
var heightData = this.images[this.currentImageIndex].getHeightData();
|
var heightData = this.images[this.currentImageIndex].getHeightData();
|
||||||
|
@ -56,6 +77,9 @@ GameLib.CustomCode.prototype.generateAttributeData = function(index, width, heig
|
||||||
|
|
||||||
}.bind(this);
|
}.bind(this);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Builds our instanced geometry
|
||||||
|
*/
|
||||||
GameLib.CustomCode.prototype.buildInstancedGeometry = function(index) {
|
GameLib.CustomCode.prototype.buildInstancedGeometry = function(index) {
|
||||||
|
|
||||||
var attributeData = this.generateAttributeData(index, 128, 128);
|
var attributeData = this.generateAttributeData(index, 128, 128);
|
||||||
|
@ -103,4 +127,6 @@ GameLib.CustomCode.prototype.buildInstancedGeometry = function(index) {
|
||||||
|
|
||||||
}.bind(this);
|
}.bind(this);
|
||||||
|
|
||||||
|
this.buildInstancedGeometry(0);
|
||||||
|
|
||||||
//@ sourceURL=entiyuLoaded.js
|
//@ sourceURL=entiyuLoaded.js
|
Loading…
Reference in New Issue