UtilityHelper.cs 511 B

12345678910111213141516171819
  1. using System;
  2. using System.Collections.Generic;
  3. using UnityEditor;
  4. using UnityEngine;
  5. namespace Utility
  6. {
  7. public static class UtilityHelper
  8. {
  9. public static void Normalize(this RectTransform rectTransform)
  10. {
  11. rectTransform.localScale = Vector2.one;
  12. rectTransform.anchorMin = Vector2.zero;
  13. rectTransform.anchorMax = Vector2.one;
  14. rectTransform.offsetMin = Vector2.zero;
  15. rectTransform.offsetMax = Vector2.zero;
  16. }
  17. }
  18. }