using UnityEngine;
using System.Collections;
using System.Collections.Generic;
using UnityEngine.UI;
namespace MoreMountains.Tools
{
///
/// RectTransform extensions
///
public static class MMRectTransformExtensions
{
///
/// Sets the left offset of a rect transform to the specified value
///
///
///
public static void MMSetLeft(this RectTransform rt, float left)
{
rt.offsetMin = new Vector2(left, rt.offsetMin.y);
}
///
/// Sets the right offset of a rect transform to the specified value
///
///
///
public static void MMSetRight(this RectTransform rt, float right)
{
rt.offsetMax = new Vector2(-right, rt.offsetMax.y);
}
///
/// Sets the top offset of a rect transform to the specified value
///
///
///
public static void MMSetTop(this RectTransform rt, float top)
{
rt.offsetMax = new Vector2(rt.offsetMax.x, -top);
}
///
/// Sets the bottom offset of a rect transform to the specified value
///
///
///
public static void MMSetBottom(this RectTransform rt, float bottom)
{
rt.offsetMin = new Vector2(rt.offsetMin.x, bottom);
}
}
}