public static void SetRectToAnchorSelectedGameObject_Shortcut() { GameObject[] selectedGameObjects = Selection.gameObjects; foreach (var g in selectedGameObjects) { RectTransform rectTransform = g.GetComponent <RectTransform>(); if (rectTransform != null) { AiryUIAnchors.SetRectToAnchor(rectTransform); } } }
private void SetRectToAnchorSelectedGameObject() { if (GUILayout.Button("Align Rect To Anchors\nCtrl+Shift+W", buttonContentStyle)) { GameObject[] selectedGameObjects = Selection.gameObjects; foreach (var g in selectedGameObjects) { RectTransform rectTransform = g.GetComponent <RectTransform>(); if (rectTransform != null) { AiryUIAnchors.SetRectToAnchor(rectTransform); } } } GUILayout.Space(5); }
private static void SetRectToAnchorSelectedGameObject() { var btnContent = new GUIContent() { text = "Align Rect To Anchors\nCtrl+Shift+W", tooltip = "Align The Rect's borders With The Anchors" }; 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.SetRectToAnchor(rectTransform); } } } GUILayout.Space(5); }