Ejemplo n.º 1
0
        public override void Render()
        {
            /*EditorGUIUtility.labelWidth = Screen.width / 2;
            *  EditorGUIUtility.fieldWidth = Screen.width / 2;*/

            _horizontalAlign.enumValueIndex = (int)(HorizontalAlign)EditorGUILayout.EnumPopup(
                "Horizontal align",
                (HorizontalAlign)Enum.GetValues(typeof(HorizontalAlign)).GetValue(_horizontalAlign.enumValueIndex),
                GUILayout.ExpandWidth(false),
                GUILayout.Width(300)
                );

            _verticalAlign.enumValueIndex = (int)(VerticalAlign)EditorGUILayout.EnumPopup(
                "Vertical align",
                (VerticalAlign)Enum.GetValues(typeof(VerticalAlign)).GetValue(_verticalAlign.enumValueIndex),
                GUILayout.ExpandWidth(false),
                GUILayout.Width(300)
                );

            _gap.intValue = EditorGUILayout.IntField("Gap", _gap.intValue, GUILayout.ExpandWidth(false));

            GUILayout.Space(15);

            /*_paddingLeft.intValue = EditorGUILayout.IntField("Padding left", _paddingLeft.intValue);
             * _paddingRight.intValue = EditorGUILayout.IntField("Padding right", _paddingRight.intValue);
             * _paddingTop.intValue = EditorGUILayout.IntField("Padding top", _paddingTop.intValue);
             * _paddingBottom.intValue = EditorGUILayout.IntField("Padding bottom", _paddingBottom.intValue);*/

            _prevPaddingLeft   = _paddingLeft.intValue;
            _prevPaddingRight  = _paddingRight.intValue;
            _prevPaddingTop    = _paddingTop.intValue;
            _prevPaddingBottom = _paddingBottom.intValue;

            EditorSettings.PaddingExpanded = EditorGUILayout.Foldout(EditorSettings.PaddingExpanded, "Padding");
            if (EditorSettings.PaddingExpanded)
            {
                SynchronizedBlock.Render(_syncPadding, _paddingLeft, _paddingRight, _paddingTop, _paddingBottom,
                                         ref _prevPaddingLeft, ref _prevPaddingRight, ref _prevPaddingTop, ref _prevPaddingBottom);
            }
        }