Skip to content

Commit

Permalink
Change visibility of bevy::core::update_frame_count to pub (#10111)
Browse files Browse the repository at this point in the history
# Objective
Closes #10107

The visibility of `bevy::core::update_frame_count` should be `pub` so it
can be used in third-party code like this:

```rust
impl Plugin for MyPlugin {
    fn build(&self, app: &mut App) {
        app.add_systems(Last, use_frame_count.before(bevy::core::update_frame_count));
    }
}
```

## Solution
Make `bevy::core::update_frame_count` public.

---

## Changelog

### Added
- Documentation for `bevy::core::update_frame_count`

### Changed
- Visibility of `bevy::core::update_frame_count` is now `pub`
  • Loading branch information
mamekoro authored Oct 16, 2023
1 parent e23d7cf commit 1258ceb
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion crates/bevy_core/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,10 @@ impl Plugin for FrameCountPlugin {
}
}

fn update_frame_count(mut frame_count: ResMut<FrameCount>) {
/// A system used to increment [`FrameCount`] with wrapping addition.
///
/// See [`FrameCount`] for more details.
pub fn update_frame_count(mut frame_count: ResMut<FrameCount>) {
frame_count.0 = frame_count.0.wrapping_add(1);
}

Expand Down

0 comments on commit 1258ceb

Please sign in to comment.