Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add paused run condition #11313

Merged
merged 6 commits into from
Jan 12, 2024
Merged

Conversation

Ixentus
Copy link
Contributor

@Ixentus Ixentus commented Jan 12, 2024

Objective

  • It is common to run a system only when the clock is paused or not paused, but this run condition doesn't exist.

Solution

  • Add the "paused" run condition.

Changelog

  • Systems can now be scheduled to run only if the clock is paused or not using .run_if(paused()) or .run_if(not(paused())).

@alice-i-cecile alice-i-cecile added A-ECS Entities, components, systems, and events C-Usability A simple quality-of-life change that makes Bevy easier to use A-Time Involves time keeping and reporting labels Jan 12, 2024
crates/bevy_time/src/common_conditions.rs Outdated Show resolved Hide resolved
Copy link
Member

@alice-i-cecile alice-i-cecile left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can simplify the run condition, as soqb pointed out. See eaad8ac for proof :) (Feel free to redo it or cherrypick).

Ixentus and others added 2 commits January 12, 2024 22:48
Co-authored-by: radiish <cb.setho@gmail.com>
@alice-i-cecile alice-i-cecile added the S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it label Jan 12, 2024
@alice-i-cecile
Copy link
Member

Thanks! Merging now.

@alice-i-cecile alice-i-cecile added this pull request to the merge queue Jan 12, 2024
Merged via the queue into bevyengine:main with commit 5c6b7d5 Jan 12, 2024
23 checks passed
Ixentus added a commit to Ixentus/bevy that referenced this pull request Jan 12, 2024
# Objective

- It is common to run a system only when the clock is paused or not
paused, but this run condition doesn't exist.

## Solution

- Add the "paused" run condition.

---

## Changelog

- Systems can now be scheduled to run only if the clock is paused or not
using `.run_if(paused())` or `.run_if(not(paused()))`.

---------

Co-authored-by: radiish <cb.setho@gmail.com>
@Ixentus Ixentus deleted the paused_condition branch January 13, 2024 13:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-ECS Entities, components, systems, and events A-Time Involves time keeping and reporting C-Usability A simple quality-of-life change that makes Bevy easier to use S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants