diff --git a/crates/bevy_ecs/src/schedule/state.rs b/crates/bevy_ecs/src/schedule/state.rs index 326c99d2afecd..da322e7d08d69 100644 --- a/crates/bevy_ecs/src/schedule/state.rs +++ b/crates/bevy_ecs/src/schedule/state.rs @@ -85,6 +85,13 @@ pub struct OnUpdate(pub S); #[derive(Resource, Default, Debug)] pub struct State(pub S); +impl std::ops::Deref for State { + type Target = S; + fn deref(&self) -> &Self::Target { + &self.0 + } +} + /// The next state of [`State`]. /// /// To queue a transition, just set the contained value to `Some(next_state)`.