added unload function to lightController.js so light is deleted when it's parent entity is

This commit is contained in:
Eric Levin 2015-03-31 19:08:30 -07:00
parent 1d5f1807f7
commit fd3fc0acdd

View file

@ -132,7 +132,7 @@
this.updateLightIDInUserData();
} else {
var that = this;
Script.setTimeout(function() { that.maybeUpdateLightIDInUserData() }, 500);
Script.setTimeout(function() { that.maybeUpdateLightIDInUserData() }, 500);
}
}
@ -213,6 +213,10 @@
this.preload = function(entityID) {
this.preOperation(entityID);
};
this.unload = function(){
Entities.deleteEntity(this.lightID);
}
this.clickReleaseOnEntity = function(entityID, mouseEvent) {
this.preOperation(entityID);