From 43745c9f17f0ba695823f861ad1a22e95ebdc66f Mon Sep 17 00:00:00 2001 From: "Dylan R. Johnston" Date: Fri, 19 Jul 2024 14:50:34 +0800 Subject: [PATCH] Removed blenvy from workflow --- simulation/src/plugins/animation_link.rs | 2 +- simulation/src/plugins/event_stream.rs | 2 +- simulation/src/plugins/planets.rs | 49 +++++++++++++++++- simulation/src/plugins/scenes/mod.rs | 64 +++++++++--------------- simulation/src/plugins/scenes/pregame.rs | 26 +++++++++- simulation/src/plugins/scenes/race.rs | 26 +++++++++- simulation/src/setup.rs | 4 +- 7 files changed, 128 insertions(+), 45 deletions(-) diff --git a/simulation/src/plugins/animation_link.rs b/simulation/src/plugins/animation_link.rs index f16ba8b..0dbcf40 100644 --- a/simulation/src/plugins/animation_link.rs +++ b/simulation/src/plugins/animation_link.rs @@ -1,4 +1,4 @@ -use std::{hash::Hash, ops::Deref}; +use std::ops::Deref; use bevy::{prelude::*, utils::HashMap}; diff --git a/simulation/src/plugins/event_stream.rs b/simulation/src/plugins/event_stream.rs index 5423477..75c81b4 100644 --- a/simulation/src/plugins/event_stream.rs +++ b/simulation/src/plugins/event_stream.rs @@ -66,7 +66,7 @@ fn scene_manager(events: Res, mut next_state: ResMut next_state.set(SceneState::Lobby), + Event::GameCreated { .. } => next_state.set(SceneState::Lobby), Event::GameStarted => next_state.set(SceneState::Lobby), Event::RaceStarted => next_state.set(SceneState::Lobby), Event::RaceFinished(_) => next_state.set(SceneState::Lobby), diff --git a/simulation/src/plugins/planets.rs b/simulation/src/plugins/planets.rs index 49170be..b2ced7d 100644 --- a/simulation/src/plugins/planets.rs +++ b/simulation/src/plugins/planets.rs @@ -1,5 +1,7 @@ use bevy::prelude::*; +use super::scenes::SceneMetadata; + pub struct PlanetsPlugin; impl Plugin for PlanetsPlugin { @@ -7,7 +9,8 @@ impl Plugin for PlanetsPlugin { app.register_type::() .register_type::() .add_systems(Update, rotate) - .add_systems(Update, orbit); + .add_systems(Update, orbit) + .add_systems(Update, add_components_on_scene_load); } } @@ -39,3 +42,47 @@ pub fn orbit(mut query: Query<(&mut Transform, &OrbitPoint)>, time: Res