Ensure PlayerInputManager's initial time is transferred at load.

This commit is contained in:
Dean Herbert 2017-04-27 17:38:00 +09:00
parent 4ab636cbb8
commit 59a3e23879

View File

@ -13,7 +13,7 @@ namespace osu.Game.Screens.Play
{
public class PlayerInputManager : PassThroughInputManager
{
private readonly ManualClock clock = new ManualClock();
private ManualClock clock;
private IFrameBasedClock parentClock;
private ReplayInputHandler replayInputHandler;
@ -47,8 +47,14 @@ namespace osu.Game.Screens.Play
{
base.LoadComplete();
//our clock will now be our parent's clock, but we want to replace this to allow manual control.
parentClock = Clock;
Clock = new FramedClock(clock);
Clock = new FramedClock(clock = new ManualClock
{
CurrentTime = parentClock.CurrentTime,
Rate = parentClock.Rate,
});
}
/// <summary>