File tree 2 files changed +5
-1
lines changed
2 files changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ use bevy::prelude::*;
2
2
use iyes_progress:: prelude:: * ;
3
3
4
4
use crate :: {
5
+ gconfig:: GameConfig ,
5
6
state:: AppState ,
6
7
transition:: { DeStateTransition , StateWithSet } ,
7
8
} ;
@@ -43,6 +44,7 @@ fn setup(mut next_state: ResMut<NextState<GameState>>) {
43
44
next_state. set ( GameState :: Loading ) ;
44
45
}
45
46
46
- fn cleanup ( mut next_state : ResMut < NextState < GameState > > ) {
47
+ fn cleanup ( mut commands : Commands , mut next_state : ResMut < NextState < GameState > > ) {
48
+ commands. remove_resource :: < GameConfig > ( ) ;
47
49
next_state. set ( GameState :: None ) ;
48
50
}
Original file line number Diff line number Diff line change @@ -4,6 +4,8 @@ use bevy::prelude::Resource;
4
4
5
5
use crate :: player:: { Player , PlayerRange } ;
6
6
7
+ /// This resource is automatically removed when
8
+ /// [`crate::state::AppState::InGame`] is exited.
7
9
#[ derive( Resource ) ]
8
10
pub struct GameConfig {
9
11
map_path : PathBuf ,
You can’t perform that action at this time.
0 commit comments