Resolve GameplayClockContainer instead of Player

This commit is contained in:
sh0ckR6
2021-09-20 10:28:58 -04:00
parent 36a20ab0b3
commit 9a1db04920
3 changed files with 15 additions and 13 deletions

View File

@ -13,6 +13,7 @@ namespace osu.Game.Screens.Play
/// <summary>
/// Encapsulates gameplay timing logic and provides a <see cref="GameplayClock"/> via DI for gameplay components to use.
/// </summary>
[Cached]
public abstract class GameplayClockContainer : Container, IAdjustableClock
{
/// <summary>
@ -35,6 +36,11 @@ namespace osu.Game.Screens.Play
/// </summary>
protected IClock SourceClock { get; private set; }
/// <summary>
/// Invoked when a seek has been performed via <see cref="Seek"/>
/// </summary>
public event Action OnSeek;
/// <summary>
/// Creates a new <see cref="GameplayClockContainer"/>.
/// </summary>
@ -88,6 +94,8 @@ namespace osu.Game.Screens.Play
// Manually process to make sure the gameplay clock is correctly updated after a seek.
GameplayClock.UnderlyingClock.ProcessFrame();
OnSeek?.Invoke();
}
/// <summary>