diff --git a/src/display3d.rs b/src/display3d.rs index 0173cec..5a1e6b0 100644 --- a/src/display3d.rs +++ b/src/display3d.rs @@ -54,6 +54,7 @@ impl Plugin for Display3dPlugin { any_component_added::>() .or_else(any_component_changed::>()), ), + dissolve_animation.run_if(any_with_component::), capture_piece.run_if(any_with_component::), skip_animation .run_if(just_pressed(KeyCode::Enter).or_else(just_pressed(MouseButton::Left))) @@ -99,8 +100,7 @@ impl Plugin for Display3dPlugin { just_pressed(KeyCode::Enter).or_else(just_pressed(MouseButton::Left)), ), ), - ) - .add_systems(Update, dissolve_animation.run_if(any_with_component::)); + ); } } @@ -1265,6 +1265,7 @@ fn capture_piece( // Wait for fade-out animation // If all pieces are done dissolving if dissolving.is_empty() { + info!("Nothing dissolving, moving on to next step!"); // Move to next state now that animation is done *state = s.next(); // This takes effect after updating all children @@ -1295,6 +1296,8 @@ fn capture_piece( game::CaptureFlow::FadeIn(_entity) => { // If we have completed the dissolve-in animation if dissolving.is_empty() { + info!("Nothing dissolving, moving on to next step!"); + // Move to next state now that animation is done *state = s.next(); } @@ -1359,7 +1362,7 @@ fn continue_title(mut next_state: ResMut>) { /// Calculating how far along the animation it should be update the material's percentage /// Materials are on the children of the tagged entity fn dissolve_animation( - mut query: Query<(Entity, &mut Dissolvable, &mut Dissolving)>, + mut query: Query<(Entity, &Dissolvable, &mut Dissolving)>, children: Query<&Children>, // Used to create Handle mut dissolve_materials: ResMut>, @@ -1371,33 +1374,26 @@ fn dissolve_animation( time: Res