mirror of
https://github.com/osukey/osukey.git
synced 2025-07-02 16:59:53 +09:00
An attempt at implementing storyboard loops.
This commit is contained in:
@ -2,26 +2,28 @@
|
||||
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Transforms;
|
||||
|
||||
namespace osu.Game.Storyboards
|
||||
{
|
||||
public class CommandLoop : CommandTimelineGroup
|
||||
{
|
||||
private double startTime;
|
||||
private int loopCount;
|
||||
public double LoopStartTime;
|
||||
public int LoopCount;
|
||||
|
||||
public CommandLoop(double startTime, int loopCount)
|
||||
{
|
||||
this.startTime = startTime;
|
||||
this.loopCount = loopCount;
|
||||
LoopStartTime = startTime;
|
||||
LoopCount = loopCount;
|
||||
}
|
||||
|
||||
public override void ApplyTransforms(Drawable drawable)
|
||||
{
|
||||
//base.ApplyTransforms(drawable);
|
||||
}
|
||||
public override void ApplyTransforms(Drawable drawable, double offset = 0)
|
||||
=> base.ApplyTransforms(drawable, offset + LoopStartTime);
|
||||
|
||||
protected override void PostProcess(Command command, TransformSequence<Drawable> sequence)
|
||||
=> sequence.Loop(Duration - command.Duration, LoopCount);
|
||||
|
||||
public override string ToString()
|
||||
=> $"{startTime} x{loopCount}";
|
||||
=> $"{LoopStartTime} x{LoopCount}";
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user