예제 #1
0
    private void SetAnchorsBottomRight()
    {
        if (GUILayout.Button("Set Anchors Bottom Right", buttonContentStyle))
        {
            GameObject[] selectedGameObjects = Selection.gameObjects;

            foreach (var g in selectedGameObjects)
            {
                RectTransform rectTransform = g.GetComponent <RectTransform>();

                if (rectTransform != null)
                {
                    AiryUIAnchors.SetAnchorsBottomRight(rectTransform);
                }
            }
        }
    }
    private void SetAnchorsBottomRight()
    {
        var btnContent = new GUIContent()
        {
            text = "Set Anchors Bottom Right", tooltip = "Move Anchors to bottom right 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.SetAnchorsBottomRight(rectTransform);
                }
            }
        }
    }