mirror of
https://github.com/ppy/osu.git
synced 2024-11-15 01:23:44 +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();
|
base.LoadComplete();
|
||||||
|
|
||||||
hitObjectPosition = hitObject.PositionBindable.GetBoundCopy();
|
hitObjectPosition = hitObject.PositionBindable.GetBoundCopy();
|
||||||
hitObjectPosition.BindValueChanged(_ => pathRequiresUpdate = true);
|
hitObjectPosition.BindValueChanged(_ => Scheduler.AddOnce(updateConnectingPath));
|
||||||
|
|
||||||
pathVersion = hitObject.Path.Version.GetBoundCopy();
|
pathVersion = hitObject.Path.Version.GetBoundCopy();
|
||||||
pathVersion.BindValueChanged(_ => pathRequiresUpdate = true);
|
pathVersion.BindValueChanged(_ => Scheduler.AddOnce(updateConnectingPath));
|
||||||
|
|
||||||
updateConnectingPath();
|
updateConnectingPath();
|
||||||
}
|
}
|
||||||
|
|
||||||
private bool pathRequiresUpdate;
|
|
||||||
|
|
||||||
protected override void Update()
|
|
||||||
{
|
|
||||||
base.Update();
|
|
||||||
|
|
||||||
if (!pathRequiresUpdate) return;
|
|
||||||
|
|
||||||
updateConnectingPath();
|
|
||||||
pathRequiresUpdate = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Updates the path connecting this control point to the next one.
|
/// Updates the path connecting this control point to the next one.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
Loading…
Reference in New Issue
Block a user