Manually set clock for storyboard if loading before being given a parent

This commit is contained in:
David Zhao 2019-07-08 18:46:12 +09:00
parent ffc3c9f8f6
commit 0cf4bf2352

View File

@ -362,7 +362,12 @@ namespace osu.Game.Screens.Play
storyboard.Masking = true; storyboard.Masking = true;
if (asyncLoad) if (asyncLoad)
LoadComponentAsync(storyboard, StoryboardContainer.Add); LoadComponentAsync(storyboard, c =>
{
// Since the storyboard was loaded before it can be added to the draw hierarchy, manually set the clock for it here.
c.Clock = GameplayClockContainer.GameplayClock;
StoryboardContainer.Add(c);
});
else else
StoryboardContainer.Add(storyboard); StoryboardContainer.Add(storyboard);
} }