| | 1 | | using UnityEngine; |
| | 2 | | public static class RectTransformExtensions { |
| 0 | 3 | | public static void SetLeft(this RectTransform rt, float left) { |
| 0 | 4 | | rt.offsetMin = new Vector2(left, rt.offsetMin.y); |
| 0 | 5 | | } |
| | 6 | |
|
| 0 | 7 | | public static void SetRight(this RectTransform rt, float right) { |
| 0 | 8 | | rt.offsetMax = new Vector2(-right, rt.offsetMax.y); |
| 0 | 9 | | } |
| | 10 | |
|
| 0 | 11 | | public static void SetTop(this RectTransform rt, float top) { |
| 0 | 12 | | rt.offsetMax = new Vector2(rt.offsetMax.x, -top); |
| 0 | 13 | | } |
| | 14 | |
|
| 0 | 15 | | public static void SetBottom(this RectTransform rt, float bottom) { |
| 0 | 16 | | rt.offsetMin = new Vector2(rt.offsetMin.x, bottom); |
| 0 | 17 | | } |
| | 18 | | } |