Remove the invalid system ordering in the animation example. (#16173)

# Objective

In the animation example, there is the code `.add_systems(Update,
init_animations.before(animate_targets))`, where `animate_targets` is
added to the `PostUpdate` in the `AnimationPlugin`. Therefore, the
`.before(animate_targets)` here is ineffective and should be removed.
This commit is contained in:
Design_Dream 2024-10-31 07:44:19 +08:00 committed by GitHub
parent 3e405ed537
commit 8b636f32cf
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 3 additions and 4 deletions

View file

@ -3,7 +3,7 @@
use std::{f32::consts::PI, time::Duration}; use std::{f32::consts::PI, time::Duration};
use bevy::{ use bevy::{
animation::{animate_targets, AnimationTargetId, RepeatAnimation}, animation::{AnimationTargetId, RepeatAnimation},
color::palettes::css::WHITE, color::palettes::css::WHITE,
pbr::CascadeShadowConfigBuilder, pbr::CascadeShadowConfigBuilder,
prelude::*, prelude::*,
@ -22,7 +22,7 @@ fn main() {
.init_resource::<ParticleAssets>() .init_resource::<ParticleAssets>()
.init_resource::<FoxFeetTargets>() .init_resource::<FoxFeetTargets>()
.add_systems(Startup, setup) .add_systems(Startup, setup)
.add_systems(Update, setup_scene_once_loaded.before(animate_targets)) .add_systems(Update, setup_scene_once_loaded)
.add_systems(Update, (keyboard_animation_control, simulate_particles)) .add_systems(Update, (keyboard_animation_control, simulate_particles))
.add_observer(observe_on_step) .add_observer(observe_on_step)
.run(); .run();

View file

@ -4,7 +4,6 @@
//! playing animations by clicking and dragging left or right within the nodes. //! playing animations by clicking and dragging left or right within the nodes.
use bevy::{ use bevy::{
animation::animate_targets,
color::palettes::{ color::palettes::{
basic::WHITE, basic::WHITE,
css::{ANTIQUE_WHITE, DARK_GREEN}, css::{ANTIQUE_WHITE, DARK_GREEN},
@ -83,7 +82,7 @@ fn main() {
..default() ..default()
})) }))
.add_systems(Startup, (setup_assets, setup_scene, setup_ui)) .add_systems(Startup, (setup_assets, setup_scene, setup_ui))
.add_systems(Update, init_animations.before(animate_targets)) .add_systems(Update, init_animations)
.add_systems( .add_systems(
Update, Update,
(handle_weight_drag, update_ui, sync_weights).chain(), (handle_weight_drag, update_ui, sync_weights).chain(),