mirror of
https://github.com/RHeavenStudioPlus/HeavenStudioPlus.git
synced 2024-11-29 21:13:07 +00:00
17 lines
No EOL
531 B
C#
17 lines
No EOL
531 B
C#
/// Credit Feaver1968
|
|
/// Sourced from - http://forum.unity3d.com/threads/scroll-to-the-bottom-of-a-scrollrect-in-code.310919/
|
|
|
|
namespace UnityEngine.UI.Extensions
|
|
{
|
|
public static class ScrollRectExtensions
|
|
{
|
|
public static void ScrollToTop(this ScrollRect scrollRect)
|
|
{
|
|
scrollRect.normalizedPosition = new Vector2(0, 1);
|
|
}
|
|
public static void ScrollToBottom(this ScrollRect scrollRect)
|
|
{
|
|
scrollRect.normalizedPosition = new Vector2(0, 0);
|
|
}
|
|
}
|
|
} |