can I get a Res
from a World
?
#11552
-
I'm making a thingy where I can add // where Health is a component and Score is a resource
let health_modifier = Modifier::new(|val: &mut Health, speed: &Speed, score: Res<Score>| {
val.0 = speed.0 + score.0;
});
// this runs whenever Speed, Score or Base<Health> changes. ok, the example doesn't make any sense but I want the first argument to be a specific component then every argument after that can be anything that implements So basically, I need a way of getting a |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
You want one of the methods on If you run into troubles with the borrow checker, see |
Beta Was this translation helpful? Give feedback.
You want one of the methods on
World
likeWorld::resource
.If you run into troubles with the borrow checker, see
resource_scope
,SystemState
or even one shot systems.