From c6147e57f40a2d670fc4f900dece5ca679fd8daf Mon Sep 17 00:00:00 2001 From: Phoqinu <176324086+Phoqinu@users.noreply.github.com> Date: Tue, 3 Dec 2024 20:48:00 +0100 Subject: [PATCH] Make `StateTransitionSteps` public (#16612) # Objective - Fixes #16594 ## Solution - `StateTransitionSteps` was made public ## Testing - _Did you test these changes? If so, how?_ I am now able to import it and use it. --- ## Showcase - Users can now write their own state scoped resources ```rust fn init_state_scoped_resource( &mut self, state: impl States, ) -> &mut Self { use bevy::state::state::StateTransitionSteps; // this PR in action self.add_systems( StateTransition, ( clear_state_scoped_resource_impl::<_, R>(state.clone()) .in_set(StateTransitionSteps::ExitSchedules), // and here init_state_scoped_resource_impl::<_, R>(state) .in_set(StateTransitionSteps::EnterSchedules), // here too ), ); self } ``` --- crates/bevy_state/src/state/transitions.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/bevy_state/src/state/transitions.rs b/crates/bevy_state/src/state/transitions.rs index f1af3570ce..4c4311a9d5 100644 --- a/crates/bevy_state/src/state/transitions.rs +++ b/crates/bevy_state/src/state/transitions.rs @@ -68,7 +68,7 @@ pub struct StateTransitionEvent { /// /// These system sets are run sequentially, in the order of the enum variants. #[derive(SystemSet, Clone, Debug, PartialEq, Eq, Hash)] -pub(crate) enum StateTransitionSteps { +pub enum StateTransitionSteps { /// States apply their transitions from [`NextState`](super::NextState) /// and compute functions based on their parent states. DependentTransitions,