refactor: don't early out client/server
This commit is contained in:
parent
63fdbab66a
commit
e0cdf94df5
|
@ -62,18 +62,17 @@ export class Listed extends Trait {
|
|||
}
|
||||
|
||||
resetQuadTreeNodes() {
|
||||
if (AVOCADO_CLIENT) {
|
||||
return;
|
||||
if (AVOCADO_SERVER) {
|
||||
const aabb = this.entity.visibleAabb;
|
||||
if (
|
||||
this.quadTreeAabb.length > 0
|
||||
&& Rectangle.isInside(this.quadTreeAabb, aabb)
|
||||
) {
|
||||
return;
|
||||
}
|
||||
this.removeQuadTreeNodes();
|
||||
this.addQuadTreeNodes();
|
||||
}
|
||||
const aabb = this.entity.visibleAabb;
|
||||
if (
|
||||
this.quadTreeAabb.length > 0
|
||||
&& Rectangle.isInside(this.quadTreeAabb, aabb)
|
||||
) {
|
||||
return;
|
||||
}
|
||||
this.removeQuadTreeNodes();
|
||||
this.addQuadTreeNodes();
|
||||
}
|
||||
|
||||
listeners() {
|
||||
|
|
|
@ -86,21 +86,19 @@ export class Emitter extends decorate(Trait) {
|
|||
return {
|
||||
|
||||
addEmitter: (key, emitter) => {
|
||||
if (AVOCADO_SERVER) {
|
||||
return;
|
||||
if (AVOCADO_CLIENT) {
|
||||
this.emitters[key] = emitter;
|
||||
this.constructor.addEmitter(emitter);
|
||||
}
|
||||
this.emitters[key] = emitter;
|
||||
this.constructor.addEmitter(emitter);
|
||||
},
|
||||
|
||||
addEmitterRenderer: (key, renderer) => {
|
||||
if (AVOCADO_SERVER) {
|
||||
return;
|
||||
if (AVOCADO_CLIENT) {
|
||||
if (!this.emitters[key]) {
|
||||
return;
|
||||
}
|
||||
this.emitters[key].addRenderer(renderer);
|
||||
}
|
||||
if (!this.emitters[key]) {
|
||||
return;
|
||||
}
|
||||
this.emitters[key].addRenderer(renderer);
|
||||
},
|
||||
|
||||
emitParticle: (key, ...args) => {
|
||||
|
|
Loading…
Reference in New Issue
Block a user