This commit is contained in:
MuHua-123
2026-09-22 14:47:51 +08:00
parent 6891f43baa
commit 1960e499c4
8 changed files with 34 additions and 34 deletions
@@ -105,12 +105,12 @@ namespace MuHua {
private void SlidingElasticity() {
Vector2 original = value;
float maxX = Viewport.resolvedStyle.width < Container.resolvedStyle.width ? 1 : 0;
if (value.x < 0) { value.x = Mathf.Lerp(value.x, 0, Time.deltaTime * 10); }
if (value.x > maxX) { value.x = Mathf.Lerp(value.x, maxX, Time.deltaTime * 10); }
if (value.x < 0) { value.x = Mathf.Lerp(value.x, 0, Time.unscaledDeltaTime * 10); }
if (value.x > maxX) { value.x = Mathf.Lerp(value.x, maxX, Time.unscaledDeltaTime * 10); }
float maxY = Viewport.resolvedStyle.height < Container.resolvedStyle.height ? 1 : 0;
if (value.y < 0) { value.y = Mathf.Lerp(value.y, 0, Time.deltaTime * 10); }
if (value.y > maxY) { value.y = Mathf.Lerp(value.y, maxY, Time.deltaTime * 10); }
if (value.y < 0) { value.y = Mathf.Lerp(value.y, 0, Time.unscaledDeltaTime * 10); }
if (value.y > maxY) { value.y = Mathf.Lerp(value.y, maxY, Time.unscaledDeltaTime * 10); }
if (original != value) { UpdateValue(value); }
}
@@ -106,8 +106,8 @@ namespace MuHua {
private void SlidingElasticity() {
float original = value;
float max = Viewport.resolvedStyle.width < Container.resolvedStyle.width ? 1 : 0;
if (value < 0) { value = Mathf.Lerp(value, 0, Time.deltaTime * 10); }
if (value > max) { value = Mathf.Lerp(value, max, Time.deltaTime * 10); }
if (value < 0) { value = Mathf.Lerp(value, 0, Time.unscaledDeltaTime * 10); }
if (value > max) { value = Mathf.Lerp(value, max, Time.unscaledDeltaTime * 10); }
if (original != value) { UpdateValue(value); }
}
/// <summary> 鼠标松开或离开 </summary>
@@ -106,8 +106,8 @@ namespace MuHua {
private void SlidingElasticity() {
float original = value;
float max = Viewport.resolvedStyle.height < Container.resolvedStyle.height ? 1 : 0;
if (value < 0) { value = Mathf.Lerp(value, 0, Time.deltaTime * 10); }
if (value > max) { value = Mathf.Lerp(value, max, Time.deltaTime * 10); }
if (value < 0) { value = Mathf.Lerp(value, 0, Time.unscaledDeltaTime * 10); }
if (value > max) { value = Mathf.Lerp(value, max, Time.unscaledDeltaTime * 10); }
if (original != value) { UpdateValue(value); }
}
/// <summary> 鼠标松开或离开 </summary>