1
0
mirror of https://github.com/ppy/osu.git synced 2025-02-13 22:03:21 +08:00

Use a frozen clock for catcher trails

This commit is contained in:
ekrctb 2021-06-16 16:14:42 +09:00
parent 1632450918
commit b087c95581

View File

@ -3,6 +3,7 @@
using osu.Framework.Graphics; using osu.Framework.Graphics;
using osu.Framework.Graphics.Pooling; using osu.Framework.Graphics.Pooling;
using osu.Framework.Timing;
using osuTK; using osuTK;
namespace osu.Game.Rulesets.Catch.UI namespace osu.Game.Rulesets.Catch.UI
@ -11,8 +12,6 @@ namespace osu.Game.Rulesets.Catch.UI
/// A trail of the catcher. /// A trail of the catcher.
/// It also represents a hyper dash afterimage. /// It also represents a hyper dash afterimage.
/// </summary> /// </summary>
// TODO: Trails shouldn't be animated when the skin has an animated catcher.
// The animation should be frozen at the animation frame at the time of the trail generation.
public class CatcherTrail : PoolableDrawable public class CatcherTrail : PoolableDrawable
{ {
public CatcherAnimationState AnimationState public CatcherAnimationState AnimationState
@ -27,7 +26,12 @@ namespace osu.Game.Rulesets.Catch.UI
Size = new Vector2(CatcherArea.CATCHER_SIZE); Size = new Vector2(CatcherArea.CATCHER_SIZE);
Origin = Anchor.TopCentre; Origin = Anchor.TopCentre;
Blending = BlendingParameters.Additive; Blending = BlendingParameters.Additive;
InternalChild = body = new SkinnableCatcher(); InternalChild = body = new SkinnableCatcher
{
// Using a frozen clock because trails should not be animated when the skin has an animated catcher.
// TODO: The animation should be frozen at the animation frame at the time of the trail generation.
Clock = new FramedClock(new ManualClock()),
};
} }
protected override void FreeAfterUse() protected override void FreeAfterUse()