private void SetAnchorsCenterOfRect() { if (GUILayout.Button("Set Anchors To Center Of Rect", buttonContentStyle)) { GameObject[] selectedGameObjects = Selection.gameObjects; foreach (var g in selectedGameObjects) { RectTransform rectTransform = g.GetComponent <RectTransform>(); if (rectTransform != null) { AiryUIAnchors.SetAnchorsCenterOfRect(rectTransform); } } } }
private void SetAnchorsCenterOfRect() { var btnContent = new GUIContent() { text = "Set Anchors To Center Of Rect", tooltip = "Move Anchors to the center of the rect" }; if (GUILayout.Button(btnContent, GUILayout.Height(50))) { GameObject[] selectedGameObjects = Selection.gameObjects; foreach (var g in selectedGameObjects) { RectTransform rectTransform = g.GetComponent <RectTransform>(); if (rectTransform != null) { AiryUIAnchors.SetAnchorsCenterOfRect(rectTransform); } } } }