Update: CC - Before Render - Moorcow (plccpu9dx0.js) 147 bytes modified

beta.r3js.org
-=yb4f310 2017-11-16 15:17:17 +01:00
parent 28e997fbf9
commit c01ad67818
1 changed files with 10 additions and 4 deletions

View File

@ -268,10 +268,10 @@ if (GameLib.Utils.UndefinedOrNull(this.initialized)) {
}
this.kill = function(enemy) {
/**
* We only remove the things we cloned
*/
this.kill = function(enemy) {
/**
* We only remove the things we cloned
*/
GameLib.Event.Emit(
GameLib.Event.REMOVE_COMPONENT,
{
@ -286,6 +286,12 @@ if (GameLib.Utils.UndefinedOrNull(this.initialized)) {
}
);
/**
* Also dispose of the THREE.js objects
*/
enemy.mesh.instance.geometry.dispose();
enemy.mesh.instance.material.dispose();
if (enemy.smokeParticleEngine) {
enemy.smokeParticleEngine.remove();
enemy.smokeParticleEngine = null;