mirror of https://github.com/ppy/osu
Implement instant movement properly
This commit is contained in:
parent
7d955839be
commit
a155814bc4
|
@ -283,9 +283,24 @@ public bool SetContent(object content)
|
|||
return true;
|
||||
}
|
||||
|
||||
public void Move(Vector2 pos) => Position = pos;
|
||||
private bool instantMove = true;
|
||||
|
||||
protected override void PopIn() => this.FadeIn(200, Easing.OutQuint);
|
||||
public void Move(Vector2 pos)
|
||||
{
|
||||
if (instantMove)
|
||||
{
|
||||
Position = pos;
|
||||
instantMove = false;
|
||||
}
|
||||
else
|
||||
this.MoveTo(pos, 200, Easing.OutQuint);
|
||||
}
|
||||
|
||||
protected override void PopIn()
|
||||
{
|
||||
instantMove |= !IsPresent;
|
||||
this.FadeIn(200, Easing.OutQuint);
|
||||
}
|
||||
|
||||
protected override void PopOut() => this.FadeOut(200, Easing.OutQuint);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue