Crate bevy_state_tool
source ·Expand description
bevy_state_tool包是bevy包的依赖包,一个微型构建状态的包。 使用时需要添加bevy包与iyes_loopless包 example for Cargo.toml:
bevy = { version = "0.9.1", features = ["dynamic"] }
iyes_loopless="0.9.1"
bevy_state_tool="0.1.0"
example for lib.rs
pub mod test;
use bevy::prelude::*;
use iyes_loopless::prelude::*;
use bevy_state_tool::GameStates;
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, GameStates)]
pub enum GameState {
GameIn,
GamePause,
StartUi,
ChooseGame,
AssetLoadingSpecial,
}
example for main.rs
use bevy::prelude::*;
use iyes_loopless::prelude::*;
use bevy_state_tool::GameStates;
fn main()
{
App::new().add_plugin(test1::Test::A).run();
}
Derive Macros
该过程宏会自动根据枚举生成对印结构体