mirror of
https://github.com/osukey/osukey.git
synced 2025-08-01 21:58:46 +09:00
use spinner's clock to drive spinner
This commit is contained in:
@ -13,7 +13,7 @@ using osu.Game.Rulesets.UI;
|
||||
|
||||
namespace osu.Game.Rulesets.Osu.Mods
|
||||
{
|
||||
public class OsuModSpunOut : Mod, IApplicableToDrawableHitObjects, IUpdatableByPlayfield
|
||||
public class OsuModSpunOut : Mod, IApplicableToDrawableHitObjects
|
||||
{
|
||||
public override string Name => "Spun Out";
|
||||
public override string Acronym => "SO";
|
||||
@ -24,9 +24,6 @@ namespace osu.Game.Rulesets.Osu.Mods
|
||||
public override bool Ranked => true;
|
||||
public override Type[] IncompatibleMods => new[] { typeof(ModAutoplay), typeof(OsuModAutopilot) };
|
||||
|
||||
private double lastFrameTime;
|
||||
private float frameDelay;
|
||||
|
||||
public void ApplyToDrawableHitObjects(IEnumerable<DrawableHitObject> drawables)
|
||||
{
|
||||
foreach (var hitObject in drawables)
|
||||
@ -39,16 +36,10 @@ namespace osu.Game.Rulesets.Osu.Mods
|
||||
var s = d as SpinnerDisc;
|
||||
|
||||
if (s.Valid)
|
||||
s.Rotate(180 / MathF.PI * frameDelay / 40);
|
||||
s.Rotate(180 / MathF.PI * (float)s.Clock.ElapsedFrameTime / 40);
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void Update(Playfield playfield)
|
||||
{
|
||||
frameDelay = (float)(playfield.Time.Current - lastFrameTime);
|
||||
lastFrameTime = playfield.Time.Current;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user