belly
belly copied to clipboard
can you pass Resources to run!()?
I want to have buttons that when clicked change the state of my game, is it possible to pass the NextState resource in so that I can change it when the button is pressed? I saw you can go the other way with the from!() and update a component from a resource but saw no way to update a resource from a component
<for tab in = Tab::iter()>
<button c:tab with=tab on:press=run!(|tab: &Tab, next: mut ResMut<NextState>| next.set(*tab))>
<img c:icon src=tab.icon()/>
</button>
</for>