Update: CC - Bacon - Entity Loaded (2xswm1bwq8.js) 422 bytes modified

beta.r3js.org
-=yb4f310 2018-02-18 17:41:02 +01:00
parent 41b05d4921
commit 28af38e80c
1 changed files with 8 additions and 28 deletions

View File

@ -43,7 +43,7 @@ this.scoreTexture = GameLib.EntityManager.Instance.findComponentById('kva68t4dm8
* Animations
*/
this.animation = GameLib.EntityManager.Instance.findComponentById('tnlwgvf12x');
this.animationSystems = GameLib.EntityManager.Instance.queryComponents(GameLib.Component.SYSTEM_ANIMATION);
this.animationSystem = GameLib.EntityManager.Instance.queryComponents(GameLib.Component.SYSTEM_ANIMATION)[0];
/**
* Lights
@ -582,27 +582,7 @@ GameLib.CustomCode.prototype.getBlockGridPositions = function (block) {
return positions;
}.bind(this);
GameLib.CustomCode.prototype.stopAnimations = function () {
this.animationSystems.map(
function (system) {
if (system.started) {
system.stop();
}
}
);
}.bind(this)
GameLib.CustomCode.prototype.startAnimations = function () {
this.animationSystems.map(
function (system) {
if (!system.started) {
system.start();
}
}
);
}.bind(this)
GameLib.CustomCode.prototype.drawGrid = function () {
var geometry = new THREE.BufferGeometry();
@ -842,7 +822,7 @@ GameLib.CustomCode.prototype.rotateBlock = function (clockwise) {
var targetRotation = this.block.center.rotation.z + Math.PI / 2;
}
this.stopAnimations();
this.animationSystem.stop();
var originalRotation = this.block.center.rotation.z;
@ -856,13 +836,13 @@ GameLib.CustomCode.prototype.rotateBlock = function (clockwise) {
this.block.center.rotation.z = originalRotation;
this.block.center.updateInstance('rotation');
this.startAnimations();
this.animationSystem.start();
} else {
this.block.center.rotation.z = originalRotation;
this.startAnimations();
this.animationSystem.start();
this.block.center.rotation.z = targetRotation;
this.block.center.updateInstance('rotation');
@ -1327,7 +1307,7 @@ GameLib.CustomCode.prototype.spawnBigBlock = function () {
GameLib.CustomCode.prototype.getNextBlock = function () {
this.stopAnimations();
this.animationSystem.stop();
this.block = this.spawnBigBlock();
@ -1338,7 +1318,7 @@ GameLib.CustomCode.prototype.getNextBlock = function () {
}
);
this.startAnimations();
this.animationSystem.start();
this.animation.addMesh(this.block.center);
@ -1376,7 +1356,7 @@ if (GameLib.Utils.UndefinedOrNull(this.subscriptions)) {
if (this.block && this.block.center) {
this.animation.removeMesh(this.block.center);
//this.animation.removeMesh(this.block.center);
GameLib.Event.Emit(
GameLib.Event.REMOVE_COMPONENT,