Add "resource_exists_and" (#23259)#23260
Conversation
|
The doc example is a bit hard to read, with a counter being negative and never incremented, and not really showing the system didn't run case: it's present in the example, but not being asserted that it doesn't do anything. I think I would prefer an example with two resources:
then:
|
|
I believe this can already be done today using // Instead of
my_system.run_if(resource_exists_and(|counter: &Counter| counter.0.is_negative()))
// I think you can use
my_system.run_if(|counter: If<Res<Counter>>| counter.0.is_negative()) |
alice-i-cecile
left a comment
There was a problem hiding this comment.
Sure. It's a bit niche, but given that the siblings exist this is fine.
mockersf
left a comment
There was a problem hiding this comment.
doc example should be improved
|
Just updated the docs as recommended. However I changed |
Adds feature: SystemCondition-satisfying closure
resource_exists_and.#23259
Testing