refactor: less noise
This commit is contained in:
parent
03035ec8b6
commit
4256d8770f
|
@ -12,7 +12,7 @@ export default class Interactions extends System {
|
|||
tick() {
|
||||
for (const entity of this.select('default')) {
|
||||
const {Interacts} = entity;
|
||||
Interacts.willInteractWith = 0
|
||||
let willInteract = false;
|
||||
const entities = Array.from(this.ecs.system('Colliders').within(Interacts.aabb()))
|
||||
.filter((other) => other !== entity)
|
||||
.sort(({Position: l}, {Position: r}) => {
|
||||
|
@ -24,8 +24,12 @@ export default class Interactions extends System {
|
|||
}
|
||||
if (other.Interactive && other.Interactive.interacting) {
|
||||
Interacts.willInteractWith = other.id;
|
||||
willInteract = true;
|
||||
}
|
||||
}
|
||||
if (!willInteract) {
|
||||
Interacts.willInteractWith = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user