1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-11 09:27:29 +08:00

Fix hold note animation not being reset

This commit is contained in:
smoogipoo 2020-04-02 17:09:08 +09:00
parent 63708532a1
commit 9552319732
2 changed files with 15 additions and 0 deletions

View File

@ -1,6 +1,9 @@
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
using System.Linq;
using osu.Framework.Bindables;
using osu.Framework.Testing;
using osu.Game.Beatmaps;
using osu.Game.Beatmaps.ControlPoints;
using osu.Game.Rulesets.Mania.Objects;
@ -10,6 +13,17 @@ namespace osu.Game.Rulesets.Mania.Tests.Skinning
{
public class TestSceneHoldNote : ManiaHitObjectTestScene
{
public TestSceneHoldNote()
{
AddToggleStep("toggle hitting", v =>
{
foreach (var holdNote in CreatedDrawables.SelectMany(d => d.ChildrenOfType<DrawableHoldNote>()))
{
((Bindable<bool>)holdNote.IsHitting).Value = v;
}
});
}
protected override DrawableManiaHitObject CreateHitObject()
{
var note = new HoldNote { Duration = 1000 };

View File

@ -69,6 +69,7 @@ namespace osu.Game.Rulesets.Mania.Skinning
if (!(sprite is TextureAnimation animation))
return;
animation.GotoFrame(0);
animation.IsPlaying = isHitting.NewValue;
}