Files
pgs/Assets/Plugins/MMFeedbacks/MMTools/Tools/MMExtensions/MMScrollRectExtensions.cs
2026-02-21 16:58:22 -08:00

31 lines
800 B
C#

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);
}
}
}