Update: CC - Snake FS - Entity Loaded (21g30t1e75.js) 686 bytes modified

beta.r3js.org
-=yb4f310 2018-03-24 12:53:55 +01:00
parent 3835a29219
commit eee408aae3
1 changed files with 24 additions and 0 deletions

View File

@ -1239,12 +1239,36 @@ GameLib.CustomCode.prototype.restore = function() {
clone.mesh.remove(); clone.mesh.remove();
} }
/**
* --- works ---
*/
clone.mesh = clone.backupMesh; clone.mesh = clone.backupMesh;
clone.backupMesh = null; clone.backupMesh = null;
clone.mesh.visible = true; clone.mesh.visible = true;
clone.mesh.updateInstance('visible'); clone.mesh.updateInstance('visible');
clone.applyToMesh(); clone.applyToMesh();
clone.backupMesh = clone.mesh; clone.backupMesh = clone.mesh;
/**
* --- end of works ---
*/
if (body.orientation === GameLib.CustomCode.ORIENTATION_UP) {
body.backupMesh.position.y += 0.5 * GameLib.CustomCode.BODY_SCALE_Y;
}
if (body.orientation === GameLib.CustomCode.ORIENTATION_DOWN) {
body.backupMesh.position.y -= 0.5 * GameLib.CustomCode.BODY_SCALE_Y;
}
if (body.orientation === GameLib.CustomCode.ORIENTATION_LEFT) {
body.backupMesh.position.x -= 0.5 * GameLib.CustomCode.BODY_SCALE_X;
}
if (body.orientation === GameLib.CustomCode.ORIENTATION_RIGHT) {
body.backupMesh.position.x += 0.5 * GameLib.CustomCode.BODY_SCALE_X;
}
clone.mesh = this.createGameMesh(this.materialBreadCorner); clone.mesh = this.createGameMesh(this.materialBreadCorner);