From 237cc6c1b8fa4bd5b678689b7ea57bf3bfb9688a Mon Sep 17 00:00:00 2001 From: hut Date: Sat, 30 Mar 2024 22:36:04 +0100 Subject: [PATCH] fix flicker in fade in effect (hopefully) --- src/camera.rs | 2 +- src/effects.rs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/camera.rs b/src/camera.rs index 0f21db8..b798f2a 100644 --- a/src/camera.rs +++ b/src/camera.rs @@ -30,7 +30,7 @@ impl Plugin for CameraControllerPlugin { // it because it felt nice. pub const RADIANS_PER_DOT: f32 = 1.0 / 180.0; -fn setup_camera( +pub fn setup_camera( mut commands: Commands, ) { // Add player diff --git a/src/effects.rs b/src/effects.rs index c7e3174..c322ee9 100644 --- a/src/effects.rs +++ b/src/effects.rs @@ -1,12 +1,12 @@ use bevy::prelude::*; -use crate::settings; +use crate::{settings, camera}; pub struct EffectsPlugin; impl Plugin for EffectsPlugin { fn build(&self, app: &mut App) { app.add_systems(Startup, setup); - app.add_systems(Startup, spawn_effects.after(setup)); + app.add_systems(Startup, spawn_effects.after(setup).after(camera::setup_camera)); app.add_systems(Update, spawn_effects); app.add_systems(Update, update_fadeblack); app.add_event::();