Make States a Resource
This commit is contained in:
parent
956122549e
commit
645dc8d017
1 changed files with 1 additions and 1 deletions
|
@ -2,7 +2,6 @@ use crate::prelude::*;
|
||||||
use anyhow::Result;
|
use anyhow::Result;
|
||||||
use assetpath::AssetPath;
|
use assetpath::AssetPath;
|
||||||
use ecs::*;
|
use ecs::*;
|
||||||
|
|
||||||
use std::any::Any;
|
use std::any::Any;
|
||||||
use std::collections::HashMap;
|
use std::collections::HashMap;
|
||||||
|
|
||||||
|
@ -118,6 +117,7 @@ impl<'a, T: TopLevelGui + 'static> From<T> for CreationType<'a> {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Collection and handler for your UI (basically a state machine)
|
/// Collection and handler for your UI (basically a state machine)
|
||||||
|
#[derive(Resource)]
|
||||||
pub struct States {
|
pub struct States {
|
||||||
states: HashMap<String, Arc<State>>,
|
states: HashMap<String, Arc<State>>,
|
||||||
current_state: Arc<Mutex<Option<Arc<State>>>>,
|
current_state: Arc<Mutex<Option<Arc<State>>>>,
|
||||||
|
|
Loading…
Reference in a new issue