[Merged by Bors] - Rename play to start and add new play method that won't overwrite the existing animation if it's already playing#6350
Conversation
249734a to
f525419
Compare
|
Bikeshed: can we call this method start_playing? |
|
Here's my bikeshed: maybe call this |
|
@MrGVSV I really like that, @alice-i-cecile what do you think? |
|
Yep, I'm on board with that change. |
f525419 to
005508e
Compare
|
@alice-i-cecile ok, done! |
| impl AnimationPlayer { | ||
| /// Start playing an animation, resetting state of the player | ||
| pub fn play(&mut self, handle: Handle<AnimationClip>) -> &mut Self { | ||
| pub fn start(&mut self, handle: Handle<AnimationClip>) -> &mut Self { |
There was a problem hiding this comment.
Does this change affect other code, such as any examples?
There was a problem hiding this comment.
I tested the examples and they work the same as before. AFAICT none of them call play on an animation that's already playing.
005508e to
e0274dc
Compare
Pietrek14
left a comment
There was a problem hiding this comment.
Except for the small thing with the docs, it looks good to me.
crates/bevy_animation/src/lib.rs
Outdated
| self | ||
| } | ||
|
|
||
| /// Like `start`, but does nothing if the requested animation is already playing. |
There was a problem hiding this comment.
Shouldn't start be wrapped in a square brackets to link the method?
There was a problem hiding this comment.
Could be wrong but it might even need a path to the method (i.e. [`start`](Self::start))
e0274dc to
2d63bf4
Compare
play_unless_already_playing method to AnimationPlayerplay to start and add new play method that won't overwrite the existing animation if it's already playing
|
@alice-i-cecile done! |
2d63bf4 to
4205190
Compare
crates/bevy_animation/src/lib.rs
Outdated
| self | ||
| } | ||
|
|
||
| /// Like [`start`](Self::start), but does nothing if the requested animation is already playing. |
There was a problem hiding this comment.
this doc is not self-explaining, could you reformulate?
There was a problem hiding this comment.
What do you think of the new doc?
4205190 to
924544e
Compare
924544e to
9549e46
Compare
|
bors r+ |
…te the existing animation if it's already playing (#6350) # Objective - You usually want to say that a given animation *should* be playing, doing nothing if it's already playing. ## Solution - Rename play to start and add new play method that won't overwrite the existing animation if it's already playing #6350 --- ## Changelog ### Changed `AnimationPlayer::play` will now not restart the animation if it's already playing ### Added An `AnimationPlayer ::start` method, which has the old behavior of `play` ## Migration guide - If you were using `play` to restart an animation that was already playing, that functionality has been moved to `start`. Now, `play` won't have any effect if the requested animation is already playing.
play to start and add new play method that won't overwrite the existing animation if it's already playingplay to start and add new play method that won't overwrite the existing animation if it's already playing
…te the existing animation if it's already playing (bevyengine#6350) # Objective - You usually want to say that a given animation *should* be playing, doing nothing if it's already playing. ## Solution - Rename play to start and add new play method that won't overwrite the existing animation if it's already playing bevyengine#6350 --- ## Changelog ### Changed `AnimationPlayer::play` will now not restart the animation if it's already playing ### Added An `AnimationPlayer ::start` method, which has the old behavior of `play` ## Migration guide - If you were using `play` to restart an animation that was already playing, that functionality has been moved to `start`. Now, `play` won't have any effect if the requested animation is already playing.
…te the existing animation if it's already playing (bevyengine#6350) # Objective - You usually want to say that a given animation *should* be playing, doing nothing if it's already playing. ## Solution - Rename play to start and add new play method that won't overwrite the existing animation if it's already playing bevyengine#6350 --- ## Changelog ### Changed `AnimationPlayer::play` will now not restart the animation if it's already playing ### Added An `AnimationPlayer ::start` method, which has the old behavior of `play` ## Migration guide - If you were using `play` to restart an animation that was already playing, that functionality has been moved to `start`. Now, `play` won't have any effect if the requested animation is already playing.
…te the existing animation if it's already playing (bevyengine#6350) # Objective - You usually want to say that a given animation *should* be playing, doing nothing if it's already playing. ## Solution - Rename play to start and add new play method that won't overwrite the existing animation if it's already playing bevyengine#6350 --- ## Changelog ### Changed `AnimationPlayer::play` will now not restart the animation if it's already playing ### Added An `AnimationPlayer ::start` method, which has the old behavior of `play` ## Migration guide - If you were using `play` to restart an animation that was already playing, that functionality has been moved to `start`. Now, `play` won't have any effect if the requested animation is already playing.
Objective
Solution
playtostartand add newplaymethod that won't overwrite the existing animation if it's already playing #6350Changelog
Changed
AnimationPlayer::playwill now not restart the animation if it's already playingAdded
An
AnimationPlayer ::startmethod, which has the old behavior ofplayMigration guide
playto restart an animation that was already playing, that functionality has been moved tostart. Now,playwon't have any effect if the requested animation is already playing.