Replies: 2 comments
-
To improve your usage of fn dummy_window(button_name: Buttons) -> impl Bundle {
(
StateScoped(button_name),
Node {
// ...
..default()
},
// ...
)
} The entity spawned with this would be de-spawned automatically when leaving the state |
Beta Was this translation helpful? Give feedback.
-
For the |
Beta Was this translation helpful? Give feedback.
-
That's my current code:
As you can see, the code above uses a lot of
OnEnter()
andOnExit()
methods to switch through the individual submenus. In principle, the behaviour to be achieved is quite simple: you want to enter a submenu -> you leave the existing one. At the same time, the basic structure of all submenus is comparable. Is there a way to generalise this so that fewer systems or fewerOnEnter()
orOnExit()
methods have to be written?Beta Was this translation helpful? Give feedback.
All reactions