mirror of
https://github.com/ppy/osu.git
synced 2025-03-28 01:47:33 +08:00
Use BindTo instead of taking the game's beatmap bindable.
This commit is contained in:
parent
609aac6453
commit
f81ffa636d
@ -11,7 +11,8 @@ namespace osu.Game.Graphics.Containers
|
|||||||
{
|
{
|
||||||
public class BeatSyncedContainer : Container
|
public class BeatSyncedContainer : Container
|
||||||
{
|
{
|
||||||
private Bindable<WorkingBeatmap> beatmap;
|
private Bindable<WorkingBeatmap> beatmap = new Bindable<WorkingBeatmap>();
|
||||||
|
|
||||||
private int lastBeat;
|
private int lastBeat;
|
||||||
private double lastTimingPointStart;
|
private double lastTimingPointStart;
|
||||||
//This is to avoid sending new beats when not at the very start of the beat
|
//This is to avoid sending new beats when not at the very start of the beat
|
||||||
@ -20,7 +21,7 @@ namespace osu.Game.Graphics.Containers
|
|||||||
|
|
||||||
protected override void Update()
|
protected override void Update()
|
||||||
{
|
{
|
||||||
if (beatmap.Value == null)
|
if (beatmap.Value?.Track == null)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
double trackCurrentTime = beatmap.Value.Track.CurrentTime;
|
double trackCurrentTime = beatmap.Value.Track.CurrentTime;
|
||||||
@ -53,7 +54,7 @@ namespace osu.Game.Graphics.Containers
|
|||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
private void load(OsuGameBase game)
|
private void load(OsuGameBase game)
|
||||||
{
|
{
|
||||||
beatmap = game.Beatmap;
|
beatmap.BindTo(game.Beatmap);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user