public static void SetAnchors(this RectTransform RT, MinMax anchors) { RT.anchorMin = anchors.min; RT.anchorMax = anchors.max; }
//Helper function to restore the anchors as above public static void SetAnchors(this UIBehaviour ui, MinMax anchors) { RectTransform RT = ui.transform as RectTransform; RT.anchorMin = anchors.min; RT.anchorMax = anchors.max; }