Update: CC - Before Render - Moorcow (72d6a2a3kc.js) 241 bytes modified

beta.r3js.org
-=yb4f310 2017-11-14 09:13:38 +01:00
parent 4280ff3af5
commit eb6c9ac944
1 changed files with 7 additions and 0 deletions

View File

@ -15,6 +15,7 @@ if (GameLib.Utils.UndefinedOrNull(this.initialized)) {
this.raycaster = this.entityLoaded.raycaster;
this.scene = this.entityLoaded.scene;
this.toBlack = new THREE.Color(0.07, 0.07, 0.07);
this.toRed = new THREE.Color(0.07, 0, 0);
this.bull.instance.visible = false;
this.star.instance.visible = false;
@ -192,10 +193,16 @@ if (this.mouseIsDown) {
mesh.instance.material.map(
function(material) {
material.color.sub(this.toBlack);
if (material.color.r <= 0) {
material.emissive.add(this.toRed);
}
}
);
} else {
mesh.instance.material.color.sub(this.toBlack);
if (mesh.instance.material.color.r <= 0) {
mesh.instance.material.emissive.add(this.toRed);
}
}
}