start fix tetris again

beta.r3js.org
-=yb4f310 2017-12-11 15:35:07 +01:00
parent 2bc511a614
commit 5e6fc54181
1 changed files with 20 additions and 0 deletions

View File

@ -106,6 +106,15 @@ GameLib.System.Animation.prototype.instanceCreated = function(data) {
this.textures[data.component.id] = data.component;
this.textureIds = Object.keys(this.textures);
}
if (data.component instanceof GameLib.D3.Animation) {
this.animations[data.component.id] = data.component;
data.component.meshes.map(
function(mesh){
this.attachAnimation(data.component, mesh)
}.bind(this)
);
}
};
GameLib.System.Animation.prototype.removeComponent = function(data) {
@ -120,6 +129,17 @@ GameLib.System.Animation.prototype.removeComponent = function(data) {
this.textureIds = Object.keys(this.textures);
}
}
if (data.component instanceof GameLib.D3.Animation) {
data.component.meshes.map(
function(mesh){
this.detachAnimation(mesh)
}.bind(this)
);
delete this.animations[data.component.id];
}
};
GameLib.System.Animation.prototype.textureAnimatedChange = function(data) {