#bevy #state #game-state #tool #方便使用bevy的一个库

nightly macro bevy_state_tool

A small package to simplify bevy writing

3 unstable releases

0.2.1 Jan 30, 2023
0.2.0 Jan 30, 2023
0.1.1 Jan 18, 2023
0.1.0 Jan 18, 2023

#47 in #game-state

MIT/Apache

9KB
127 lines

bevy_state_tool

方便使用bevy的一个库 A library for easy use of bevy


lib.rs:

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();
}

Dependencies

~1.5MB
~37K SLoC