-
-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Repeat any arbitrary Sequence
#42
Comments
This is extremely important feature, will be supported in the future! I am currently doing some major changes to the |
Nice. Btw, I'm liking how the new macros are turning out. I tried playing around with it, but it looks likes that completions are starting to show some cracks. For example: let sequence = play!(
commands,
act!(
(cube_ids[c], Transform),
start = {transforms[c]}.scale,
end = Vec3::splat(0.9),
)
.with_ease(ease::circ::ease_in_out)
.animate(1.0),
|
); When you start typing with your cursor at |
@musjj Thanks for trying it out! I am looking to resolve this issue by replacing the let sequence = [
act!(
(cube_ids[c], Transform),
start = {transforms[c]}.scale,
end = Vec3::splat(0.9),
)
.with_ease(ease::circ::ease_in_out)
.animate(1.0),
act!(
(cube_ids[c], Transform),
start = {transforms[c]}.transform,
end = Transform::default(),
)
.with_ease(ease::circ::ease_in_out)
.animate(1.0),
]
.play(&mut commands)
.all(); So we are now back to rust land and completions just works! :D I am also a huge fan of autocomplete & autoformat working hahahaha |
Hmm after some experimentation, I don't think I can achieve what I mentioned above, because all types inside an array must be the same, the best I can do is sth like this: let sequence = [
act!(
(cube_ids[c], Transform),
start = {transforms[c]}.scale,
end = Vec3::splat(0.9),
)
.with_ease(ease::circ::ease_in_out)
.play(&mut commands, 1.0),
act!(
(cube_ids[c], Transform),
start = {transforms[c]}.transform,
end = Transform::default(),
)
.with_ease(ease::circ::ease_in_out)
.play(&mut commands, 1.0),
]
.all(); Each But I do wonder how does bevy managed to support this kind of thing in the |
ahh I found it, maybe it would be useful to use this macro_rules! impl_system_collection {
($(($param: ident, $sys: ident)),*) => {
impl<$($param, $sys),*> IntoSystemConfigs<(SystemConfigTupleMarker, $($param,)*)> for ($($sys,)*)
where
$($sys: IntoSystemConfigs<$param>),*
{
#[allow(non_snake_case)]
fn into_configs(self) -> SystemConfigs {
let ($($sys,)*) = self;
SystemConfigs::Configs {
configs: vec![$($sys.into_configs(),)*],
collective_conditions: Vec::new(),
chained: Chain::No,
}
}
}
}
}
all_tuples!(impl_system_collection, 1, 20, P, S); |
Hey I came up with something much simpler now haha 🤣 let sequence = commands
.add_motion(
cube.to_scale(Vec3::splat(0.9))
.with_ease(circ_ease)
.animate(1.0),
)
.add_motion(
cube.to_translation_x(cube.transform.translation.x + 1.0)
.with_ease(circ_ease)
.animate(1.0),
)
.add_motion(
cube.to_rotation(Quat::from_euler(
EulerRot::XYZ,
0.0,
f32::to_radians(90.0),
0.0,
))
.with_ease(circ_ease)
.animate(1.0),
)
.all(); Don't mind the |
It would be nice if you can repeat any arbitrary sequence, like other bevy tweening plugins:
For example:
You can manually do this, but metadatas will make it easy to mix and match repeat counts/styles in a single sequence.
The text was updated successfully, but these errors were encountered: