mirror of
https://github.com/ppy/osu
synced 2025-01-28 16:53:02 +00:00
Add an IAnimationTimeReference
to DrawableHitObject
to synchronise all animations
This commit is contained in:
parent
214bc40570
commit
64498e95a4
@ -30,7 +30,7 @@ using osuTK.Graphics;
|
||||
namespace osu.Game.Rulesets.Objects.Drawables
|
||||
{
|
||||
[Cached(typeof(DrawableHitObject))]
|
||||
public abstract partial class DrawableHitObject : PoolableDrawableWithLifetime<HitObjectLifetimeEntry>
|
||||
public abstract partial class DrawableHitObject : PoolableDrawableWithLifetime<HitObjectLifetimeEntry>, IAnimationTimeReference
|
||||
{
|
||||
/// <summary>
|
||||
/// Invoked after this <see cref="DrawableHitObject"/>'s applied <see cref="HitObject"/> has had its defaults applied.
|
||||
@ -425,11 +425,13 @@ namespace osu.Game.Rulesets.Objects.Drawables
|
||||
|
||||
LifetimeEnd = double.MaxValue;
|
||||
|
||||
double transformTime = HitObject.StartTime - InitialLifetimeOffset;
|
||||
|
||||
clearExistingStateTransforms();
|
||||
|
||||
using (BeginAbsoluteSequence(transformTime))
|
||||
double initialTransformsTime = HitObject.StartTime - InitialLifetimeOffset;
|
||||
|
||||
AnimationStartTime.Value = initialTransformsTime;
|
||||
|
||||
using (BeginAbsoluteSequence(initialTransformsTime))
|
||||
UpdateInitialTransforms();
|
||||
|
||||
using (BeginAbsoluteSequence(StateUpdateTime))
|
||||
@ -721,6 +723,8 @@ namespace osu.Game.Rulesets.Objects.Drawables
|
||||
if (CurrentSkin != null)
|
||||
CurrentSkin.SourceChanged -= skinSourceChanged;
|
||||
}
|
||||
|
||||
public Bindable<double> AnimationStartTime { get; } = new BindableDouble();
|
||||
}
|
||||
|
||||
public abstract partial class DrawableHitObject<TObject> : DrawableHitObject
|
||||
|
Loading…
Reference in New Issue
Block a user