bevy/crates/bevy_ecs/src
MrGVSV f00aec2454 Added method to restart the current state (#3328)
# Objective

It would be useful to be able to restart a state (such as if an operation fails and needs to be retried from `on_enter`). Currently, it seems the way to restart a state is to transition to a dummy state and then transition back.

## Solution

The solution is to add a `restart` method on `State<T>` that allows for transitioning to the already-active state.

## Context

Based on [this](https://discord.com/channels/691052431525675048/742884593551802431/920335041756815441) question from the Discord.

Closes #2385


Co-authored-by: Carter Anderson <mcanders1@gmail.com>
2022-02-04 03:07:18 +00:00
..
entity Fix doc_markdown lints in bevy_ecs (#3473) 2022-01-06 00:43:37 +00:00
query Add &World as SystemParam (#2923) 2022-02-03 23:43:25 +00:00
schedule Added method to restart the current state (#3328) 2022-02-04 03:07:18 +00:00
storage Fix doc_markdown lints in bevy_ecs (#3473) 2022-01-06 00:43:37 +00:00
system Add &World as SystemParam (#2923) 2022-02-03 23:43:25 +00:00
world Use ManuallyDrop instead of forget in insert_resource_with_id (#2947) 2022-02-03 22:34:31 +00:00
archetype.rs Fix doc_markdown lints in bevy_ecs (#3473) 2022-01-06 00:43:37 +00:00
bundle.rs Fix doc_markdown lints in bevy_ecs (#3473) 2022-01-06 00:43:37 +00:00
change_detection.rs default features from bevy_asset and bevy_ecs can actually be disabled (#3097) 2021-11-13 21:15:22 +00:00
component.rs Remove ComponentsError (#3716) 2022-01-21 00:12:32 +00:00
event.rs Simplify sending empty events (#2935) 2022-02-04 01:24:47 +00:00
lib.rs Mark .id() methods which return an Entity as must_use (#3750) 2022-01-23 14:24:37 +00:00
reflect.rs Add FromReflect trait to convert dynamic types to concrete types (#1395) 2021-12-26 18:49:01 +00:00