Replies: 1 comment
-
The way I understand it, The way I've always handled this is by making use of the OnEnter() and OnExit() schedules to manage resources that only exist when in certain states. Remember Remember that bevy is designed for you to pick and choose the functionality that you want, if the state system has a problem that causes it to not work for your case, such as wanting the safety of if my enum is this variant, it is garunteed to have this data, just write your own state machine. Bevy's state is just built with the same tools you have available, so theres no inherent performance cost to replacing it with different logic. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
While using states I would like to access data which is specific to one state variant. In the below example this would be the
Entity
inside theActive
variant.I know that it is possible to query the state from any system like follows.
I then always have to check, which state variant is actually active. Even inside systems which specifically run only within a single state variant (e.g.
Active
), I still have to do this.Can a system running only in one state variant directly access the state as if it was this exact variant?
Beta Was this translation helpful? Give feedback.
All reactions