bevyengine / bevyengine/bevy

`State` scope for `add_systems`

Open
#11,256 0 comments 0 reactions 0 assignees View on GitHub
A-ECS C-Usability X-Needs-SME
Dominant language
Rust
Stars
48.2k
Forks
4.8k
Avg merge
3d 22h
Merged PRs (30d)
161

Description

## What problem does this solve or what need does it fill?

Add a helper method to add systems with condition `in_state`. I believe this would be good to code organization.

## What solution would you like?

Like
```rust
.state_scope_add_systems(
AppState::Game,
[
(Update, some_system),
(
FixedUpdate,
(
some_system_a,
some_system_b,
)
),
],
)
```

## Additional context

I have tried to implement such a thing, but met troubles dealing with `ScheduleLabel`.
`impl ScheduleLabel` accepts all same schedule, while a trait object cannot be forwarded to `add_systems` nor
be processed like in it.

Maybe I can do this with macros?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.