SamsonGame/Assets/Sources/Feel/MMTools/Tools/MMExtensions/MMScrollRectExtensions.cs

31 lines
830 B
C#
Raw Normal View History

2021-12-29 20:50:11 +03:00
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
using UnityEngine.UI;
namespace MoreMountains.Tools
{
/// <summary>
/// Scrollrect extensions
/// </summary>
public static class ScrollRectExtensions
{
/// <summary>
/// Scrolls a scroll rect to the top
/// </summary>
/// <param name="scrollRect"></param>
public static void MMScrollToTop(this ScrollRect scrollRect)
{
scrollRect.normalizedPosition = new Vector2(0, 1);
}
/// <summary>
/// Scrolls a scroll rect to the bottom
/// </summary>
public static void MMScrollToBottom(this ScrollRect scrollRect)
{
scrollRect.normalizedPosition = new Vector2(0, 0);
}
}
}