I'm sure there are some pitfalls here, but I've been trying to extend the LevelSelection behaviour, and rather than completely replace it (because I want neighbours, and why rewrite it?) I've been trying to extend it by shoving a system in the middle.
In doing so I noticed the bevy_ecs_ldtk::systems::apply_level_selection system runs every single frame, even when nothing should be being updated. This meant that my system also had to run every frame - in order to stop the changed being overridden - except my calculations were considerably more expensive so I really didn't want that to happen.
As with my other PR, it's a little brute-force but hopefully a starting point for discussion.
Sidenote: should LevelSelection be a component rather than a Resource? Similar to LevelSet.
I'm sure there are some pitfalls here, but I've been trying to extend the
LevelSelection
behaviour, and rather than completely replace it (because I want neighbours, and why rewrite it?) I've been trying to extend it by shoving a system in the middle.In doing so I noticed the
bevy_ecs_ldtk::systems::apply_level_selection
system runs every single frame, even when nothing should be being updated. This meant that my system also had to run every frame - in order to stop the changed being overridden - except my calculations were considerably more expensive so I really didn't want that to happen.As with my other PR, it's a little brute-force but hopefully a starting point for discussion.
Sidenote: should
LevelSelection
be a component rather than aResource
? Similar toLevelSet
.