61 lines
1.5 KiB
JavaScript
61 lines
1.5 KiB
JavaScript
if (data.entity === this.parentEntity) {
|
|
console.log('snail runner loaded');
|
|
} else {
|
|
return;
|
|
}
|
|
|
|
/**
|
|
* Custom Code Components
|
|
*/
|
|
this.beforeRender = GameLib.EntityManager.Instance.findComponentById('94xi7aitax');
|
|
this.mouseMove = GameLib.EntityManager.Instance.findComponentById('jz3qg0174l');
|
|
|
|
/**
|
|
* Meshes
|
|
*/
|
|
this.snail = GameLib.EntityManager.Instance.findComponentById('z2izbq1hcz');
|
|
this.cloud = GameLib.EntityManager.Instance.findComponentById('jbvm17iwfx');
|
|
this.solar = GameLib.EntityManager.Instance.findComponentById('lq5xyiu8n4');
|
|
this.treesLeft = GameLib.EntityManager.Instance.findComponentById('lq0rxnjq3n');
|
|
this.treesRight = GameLib.EntityManager.Instance.findComponentById('oag0yr1rav');
|
|
this.road = GameLib.EntityManager.Instance.findComponentById('4furha3wst');
|
|
|
|
/**
|
|
* Road Sections
|
|
*/
|
|
this.sections = [{
|
|
left : this.treesLeft,
|
|
road : this.road,
|
|
right : this.treesRight
|
|
}];
|
|
|
|
/**
|
|
* Camera
|
|
*/
|
|
this.camera = GameLib.EntityManager.Instance.findComponentById('hd8dsn7o4c');
|
|
|
|
var cloneLeft = this.treesLeft.clone();
|
|
var cloneRoad = this.road.clone();
|
|
var cloneRight = this.treesRight.clone();
|
|
|
|
|
|
for (var i = 0; i < 20; i++) {
|
|
|
|
this.sections.push({
|
|
left : cloneLeft,
|
|
road : cloneRoad,
|
|
right : cloneRight
|
|
})
|
|
|
|
cloneLeft = cloneLeft.clone();
|
|
cloneRoad = cloneRoad.clone();
|
|
cloneRight = cloneRight.clone();
|
|
}
|
|
|
|
/**
|
|
* Activate our custom code components
|
|
*/
|
|
this.beforeRender.entityLoaded = this;
|
|
this.mouseMove.entityLoaded = this;
|
|
|
|
//@ sourceURL=entityLoaded.js
|