Allow ignoring the Time.timeScale on ScrollSnaps (Horiz + Vert)
parent
f643e868d1
commit
67aefea569
|
@ -35,7 +35,7 @@ namespace UnityEngine.UI.Extensions
|
|||
}
|
||||
else if (_lerp)
|
||||
{
|
||||
_screensContainer.localPosition = Vector3.Lerp(_screensContainer.localPosition, _lerp_target, transitionSpeed * Time.deltaTime);
|
||||
_screensContainer.localPosition = Vector3.Lerp(_screensContainer.localPosition, _lerp_target, transitionSpeed * (UseTimeScale ? Time.deltaTime : Time.unscaledDeltaTime));
|
||||
if (Vector3.Distance(_screensContainer.localPosition, _lerp_target) < 0.1f)
|
||||
{
|
||||
_screensContainer.localPosition = _lerp_target;
|
||||
|
@ -292,4 +292,4 @@ namespace UnityEngine.UI.Extensions
|
|||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -76,6 +76,9 @@ namespace UnityEngine.UI.Extensions
|
|||
[Tooltip("Speed at which the ScrollRect will keep scrolling before slowing down and stopping (optional)")]
|
||||
public int SwipeVelocityThreshold = 100;
|
||||
|
||||
[Tooltip("Use time scale instead of unscaled time (optional)")]
|
||||
public Boolean UseTimeScale = true;
|
||||
|
||||
[Tooltip("The visible bounds area, controls which items are visible/enabled. *Note Should use a RectMask. (optional)")]
|
||||
public RectTransform MaskArea;
|
||||
|
||||
|
@ -592,4 +595,4 @@ namespace UnityEngine.UI.Extensions
|
|||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -35,7 +35,7 @@ namespace UnityEngine.UI.Extensions
|
|||
}
|
||||
else if (_lerp)
|
||||
{
|
||||
_screensContainer.localPosition = Vector3.Lerp(_screensContainer.localPosition, _lerp_target, transitionSpeed * Time.deltaTime);
|
||||
_screensContainer.localPosition = Vector3.Lerp(_screensContainer.localPosition, _lerp_target, transitionSpeed * (UseTimeScale ? Time.deltaTime : Time.unscaledDeltaTime));
|
||||
if (Vector3.Distance(_screensContainer.localPosition, _lerp_target) < 0.1f)
|
||||
{
|
||||
_screensContainer.localPosition = _lerp_target;
|
||||
|
@ -291,4 +291,4 @@ namespace UnityEngine.UI.Extensions
|
|||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue