mirror of
https://github.com/ppy/osu.git
synced 2024-12-14 23:52:57 +08:00
Create dependencies before children are loaded
This commit is contained in:
parent
b90cdfbfd1
commit
ca3186f34c
@ -25,13 +25,20 @@ namespace osu.Game.Tests.Visual
|
||||
Clock = new EditorClock(new ControlPointInfo(), 5000, BeatDivisor) { IsCoupled = false };
|
||||
}
|
||||
|
||||
protected override IReadOnlyDependencyContainer CreateLocalDependencies(IReadOnlyDependencyContainer parent)
|
||||
{
|
||||
var dependencies = new DependencyContainer(base.CreateLocalDependencies(parent));
|
||||
|
||||
dependencies.Cache(BeatDivisor);
|
||||
dependencies.CacheAs<IFrameBasedClock>(Clock);
|
||||
dependencies.CacheAs<IAdjustableClock>(Clock);
|
||||
|
||||
return dependencies;
|
||||
}
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
private void load()
|
||||
{
|
||||
Dependencies.Cache(BeatDivisor);
|
||||
Dependencies.CacheAs<IFrameBasedClock>(Clock);
|
||||
Dependencies.CacheAs<IAdjustableClock>(Clock);
|
||||
|
||||
Beatmap.BindValueChanged(beatmapChanged, true);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user