mirror of
https://github.com/ppy/osu.git
synced 2024-11-13 16:13:34 +08:00
simplify scheduling logic
This commit is contained in:
parent
5fa7f6ec53
commit
e1186080b8
@ -51,26 +51,14 @@ namespace osu.Game.Rulesets.Osu.Edit.Blueprints.Sliders.Components
|
||||
base.LoadComplete();
|
||||
|
||||
hitObjectPosition = hitObject.PositionBindable.GetBoundCopy();
|
||||
hitObjectPosition.BindValueChanged(_ => pathRequiresUpdate = true);
|
||||
hitObjectPosition.BindValueChanged(_ => Scheduler.AddOnce(updateConnectingPath));
|
||||
|
||||
pathVersion = hitObject.Path.Version.GetBoundCopy();
|
||||
pathVersion.BindValueChanged(_ => pathRequiresUpdate = true);
|
||||
pathVersion.BindValueChanged(_ => Scheduler.AddOnce(updateConnectingPath));
|
||||
|
||||
updateConnectingPath();
|
||||
}
|
||||
|
||||
private bool pathRequiresUpdate;
|
||||
|
||||
protected override void Update()
|
||||
{
|
||||
base.Update();
|
||||
|
||||
if (!pathRequiresUpdate) return;
|
||||
|
||||
updateConnectingPath();
|
||||
pathRequiresUpdate = false;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Updates the path connecting this control point to the next one.
|
||||
/// </summary>
|
||||
|
Loading…
Reference in New Issue
Block a user