mirror of
https://github.com/osukey/osukey.git
synced 2025-08-03 22:56:36 +09:00
Reduce duplicate code
This commit is contained in:
@ -107,17 +107,18 @@ namespace osu.Game.Rulesets.Osu.Edit.Masks.SliderMasks
|
||||
|
||||
private void endCurve()
|
||||
{
|
||||
HitObject.ControlPoints = segments.SelectMany(s => s.ControlPoints).Concat(cursor.Yield()).ToArray();
|
||||
HitObject.PathType = HitObject.ControlPoints.Length > 2 ? PathType.Bezier : PathType.Linear;
|
||||
HitObject.Distance = segments.Sum(s => s.Distance);
|
||||
|
||||
updateSlider();
|
||||
EndPlacement();
|
||||
}
|
||||
|
||||
protected override void Update()
|
||||
{
|
||||
base.Update();
|
||||
updateSlider();
|
||||
}
|
||||
|
||||
private void updateSlider()
|
||||
{
|
||||
for (int i = 0; i < segments.Count; i++)
|
||||
segments[i].Calculate(i == segments.Count - 1 ? (Vector2?)cursor : null);
|
||||
|
||||
|
Reference in New Issue
Block a user