|
1 | 1 | use bevy::prelude::*; |
2 | | -use bevy_tween::interpolate::{AngleZ, Translation}; |
| 2 | +use bevy_tween::interpolate::{translation, AngleZ, Translation}; |
3 | 3 | use bevy_tween::prelude::*; |
4 | 4 | use bevy_tween::{ |
5 | 5 | bevy_time_runner::{TimeRunner, TimeSpan}, |
@@ -52,16 +52,14 @@ fn setup(mut commands: Commands) { |
52 | 52 | EaseKind::QuadraticInOut, |
53 | 53 | ComponentTween::new_target( |
54 | 54 | TargetComponent::marker(), |
55 | | - Translation { |
56 | | - start: Vec3::new(start_x, y, 0.), |
57 | | - end: Vec3::new(end_x, y, 0.), |
58 | | - }, |
| 55 | + translation(Vec3::new(start_x, y, 0.), Vec3::new(end_x, y, 0.)) |
59 | 56 | ), |
60 | 57 | ComponentTween::new_target( |
61 | 58 | TargetComponent::marker(), |
62 | 59 | AngleZ { |
63 | 60 | start: angle_start, |
64 | 61 | end: angle_end, |
| 62 | + delta: false |
65 | 63 | }, |
66 | 64 | ), |
67 | 65 | )); |
@@ -93,16 +91,14 @@ fn setup(mut commands: Commands) { |
93 | 91 | EaseKind::QuadraticInOut, |
94 | 92 | ComponentTween::new_target( |
95 | 93 | TargetComponent::marker(), |
96 | | - Translation { |
97 | | - start: Vec3::new(start_x, y, 0.), |
98 | | - end: Vec3::new(end_x, y, 0.), |
99 | | - }, |
| 94 | + translation(Vec3::new(start_x, y, 0.), Vec3::new(end_x, y, 0.)) |
100 | 95 | ), |
101 | 96 | ComponentTween::new_target( |
102 | 97 | TargetComponent::marker(), |
103 | 98 | AngleZ { |
104 | 99 | start: angle_start, |
105 | 100 | end: angle_end, |
| 101 | + delta: false |
106 | 102 | }, |
107 | 103 | ), |
108 | 104 | )); |
@@ -132,16 +128,14 @@ fn setup(mut commands: Commands) { |
132 | 128 | EaseKind::QuadraticInOut, |
133 | 129 | ComponentTween::new_target( |
134 | 130 | TargetComponent::marker(), |
135 | | - Translation { |
136 | | - start: Vec3::new(start_x, y, 0.), |
137 | | - end: Vec3::new(end_x, y, 0.), |
138 | | - }, |
| 131 | + translation(Vec3::new(start_x, y, 0.), Vec3::new(end_x, y, 0.)) |
139 | 132 | ), |
140 | 133 | ComponentTween::new_target( |
141 | 134 | TargetComponent::marker(), |
142 | 135 | AngleZ { |
143 | 136 | start: angle_start, |
144 | 137 | end: angle_end, |
| 138 | + delta: false |
145 | 139 | }, |
146 | 140 | ), |
147 | 141 | )); |
@@ -176,13 +170,15 @@ fn setup(mut commands: Commands) { |
176 | 170 | Translation { |
177 | 171 | start: Vec3::new(start_x, y, 0.), |
178 | 172 | end: Vec3::new(end_x, y, 0.), |
| 173 | + delta: false |
179 | 174 | }, |
180 | 175 | ), |
181 | 176 | ComponentTween::new_target( |
182 | 177 | TargetComponent::marker(), |
183 | 178 | AngleZ { |
184 | 179 | start: angle_start, |
185 | 180 | end: angle_end, |
| 181 | + delta: false |
186 | 182 | }, |
187 | 183 | ), |
188 | 184 | )); |
@@ -216,16 +212,14 @@ fn setup(mut commands: Commands) { |
216 | 212 | EaseKind::QuadraticInOut, |
217 | 213 | ComponentTween::new_target( |
218 | 214 | sprite, |
219 | | - Translation { |
220 | | - start: Vec3::new(start_x, y, 0.), |
221 | | - end: Vec3::new(end_x, y, 0.), |
222 | | - }, |
| 215 | + translation(Vec3::new(start_x, y, 0.), Vec3::new(end_x, y, 0.)) |
223 | 216 | ), |
224 | 217 | ComponentTween::new_target( |
225 | 218 | sprite, |
226 | 219 | AngleZ { |
227 | 220 | start: angle_start, |
228 | 221 | end: angle_end, |
| 222 | + delta: false |
229 | 223 | }, |
230 | 224 | ), |
231 | 225 | )); |
|
0 commit comments