mirror of
https://github.com/bevyengine/bevy
synced 2024-11-10 15:14:50 +00:00
07aa9e5641
# Objective Prerequisite to #13579. Combine separate `Substates` transition systems to centralize transition logic and exert more control over it. ## Solution Originally the transition happened in 2 stages: - `apply_state_transition` in `ManualTransitions` handled `NextState`, - closure system in `DependentTransitions` handled parent-related changes, insertion and deletion of the substate. Now: - Both transitions are processed in a single closure system during `DependentTransitions`. - Since `Substates` no longer use `ManualTransitions`, it's been renamed to `RootTransitions`. Only root states use it. - When `Substates` state comes into existence, it will try to initialize from `NextState` and fallback to `should_exist` result. - Remove `apply_state_transition` from public API. Consequentially, removed the possibility of multiple `StateTransitionEvent`s when both transition systems fire in a single frame. ## Changelog - Renamed `ManualTransitions` to `RootTransitions`. - `Substates` will initialize their value with `NextState` if available and fallback to `should_exist` result. ## Migration Guide - `apply_state_transition` is no longer publicly available, run the `StateTransition` schedule instead. --------- Co-authored-by: Alice Cecile <alice.i.cecile@gmail.com> |
||
---|---|---|
.. | ||
macros | ||
src | ||
Cargo.toml |