mirror of
https://github.com/kristoferssolo/maze-ascension.git
synced 2025-10-21 19:20:34 +00:00
fix(assets): wait for assets load
This commit is contained in:
parent
7ff943e829
commit
2341ee664e
2
Cargo.lock
generated
2
Cargo.lock
generated
@ -3129,7 +3129,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "maze-ascension"
|
name = "maze-ascension"
|
||||||
version = "1.0.1"
|
version = "1.0.2"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"anyhow",
|
"anyhow",
|
||||||
"bevy",
|
"bevy",
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "maze-ascension"
|
name = "maze-ascension"
|
||||||
authors = ["Kristofers Solo <dev@kristofers.xyz>"]
|
authors = ["Kristofers Solo <dev@kristofers.xyz>"]
|
||||||
version = "1.0.1"
|
version = "1.0.2"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
|
|||||||
@ -37,8 +37,8 @@ pub struct MazeAssets {
|
|||||||
impl MazeAssets {
|
impl MazeAssets {
|
||||||
/// Creates a new instance of MazeAssets with all necessary meshes and materials.
|
/// Creates a new instance of MazeAssets with all necessary meshes and materials.
|
||||||
pub fn new(
|
pub fn new(
|
||||||
meshes: &mut ResMut<Assets<Mesh>>,
|
meshes: &mut Assets<Mesh>,
|
||||||
materials: &mut ResMut<Assets<StandardMaterial>>,
|
materials: &mut Assets<StandardMaterial>,
|
||||||
global_config: &GlobalMazeConfig,
|
global_config: &GlobalMazeConfig,
|
||||||
) -> Self {
|
) -> Self {
|
||||||
let custom_materials = RosePineDawn::iter()
|
let custom_materials = RosePineDawn::iter()
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
mod assets;
|
pub mod assets;
|
||||||
pub mod commands;
|
pub mod commands;
|
||||||
pub mod components;
|
pub mod components;
|
||||||
mod systems;
|
mod systems;
|
||||||
|
|||||||
@ -4,6 +4,8 @@
|
|||||||
use bevy::prelude::*;
|
use bevy::prelude::*;
|
||||||
|
|
||||||
use crate::{
|
use crate::{
|
||||||
|
hint::assets::HintAssets,
|
||||||
|
player::assets::PlayerAssets,
|
||||||
screens::Screen,
|
screens::Screen,
|
||||||
theme::{interaction::InteractionAssets, prelude::*},
|
theme::{interaction::InteractionAssets, prelude::*},
|
||||||
};
|
};
|
||||||
@ -33,6 +35,10 @@ fn continue_to_title_screen(mut next_screen: ResMut<NextState<Screen>>) {
|
|||||||
next_screen.set(Screen::Title);
|
next_screen.set(Screen::Title);
|
||||||
}
|
}
|
||||||
|
|
||||||
const fn all_assets_loaded(interaction_assets: Option<Res<InteractionAssets>>) -> bool {
|
const fn all_assets_loaded(
|
||||||
interaction_assets.is_some()
|
player_assets: Option<Res<PlayerAssets>>,
|
||||||
|
interaction_assets: Option<Res<InteractionAssets>>,
|
||||||
|
hints_assets: Option<Res<HintAssets>>,
|
||||||
|
) -> bool {
|
||||||
|
player_assets.is_some() && interaction_assets.is_some() && hints_assets.is_some()
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user