File tree Expand file tree Collapse file tree 2 files changed +5
-5
lines changed
crates/bevy_ecs/src/schedule Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -692,7 +692,7 @@ pub mod common_conditions {
692692 /// assert_eq!(world.resource::<Counter>().0, 0);
693693 /// ```
694694 pub fn in_state < S : States > ( state : S ) -> impl FnMut ( Res < State < S > > ) -> bool + Clone {
695- move |current_state : Res < State < S > > | current_state. 0 == state
695+ move |current_state : Res < State < S > > | * current_state. get ( ) == state
696696 }
697697
698698 /// Generates a [`Condition`](super::Condition)-satisfying closure that returns `true`
@@ -751,7 +751,7 @@ pub mod common_conditions {
751751 state : S ,
752752 ) -> impl FnMut ( Option < Res < State < S > > > ) -> bool + Clone {
753753 move |current_state : Option < Res < State < S > > > | match current_state {
754- Some ( current_state) => current_state. 0 == state,
754+ Some ( current_state) => * current_state. get ( ) == state,
755755 None => false ,
756756 }
757757 }
Original file line number Diff line number Diff line change @@ -85,9 +85,9 @@ pub struct OnUpdate<S: States>(pub S);
8585#[ derive( Resource , Default , Debug ) ]
8686pub struct State < S : States > ( S ) ;
8787
88- impl < S : States > std :: ops :: Deref for State < S > {
89- type Target = S ;
90- fn deref ( & self ) -> & Self :: Target {
88+ impl < S : States > State < S > {
89+ /// Get the current state.
90+ pub fn get ( & self ) -> & S {
9191 & self . 0
9292 }
9393}
You can’t perform that action at this time.
0 commit comments