pc.Entity.prototype.destroyOld = pc.Entity.prototype.destroy; pc.Entity.prototype.destroy = function() { this.fire('beforedestroy', this); pc.Entity.prototype.destroyOld.apply(this); }