public static void SubFoldout(
            string header, Dictionary <Material, Toggles> foldouts,
            Dictionary <Action, GUIContent> buttons, Material mat,
            MaterialEditor me, Action DisplayTabContent, bool error
            )
        {
            int  buttonCount = buttons != null ? buttons.Count : 0;
            bool isToggled   = DisplayErrorSubFoldoutElements(me, header, foldouts[mat].GetState(header), buttonCount, 0, error);

            foldouts[mat].SetState(header, isToggled);

            if (buttons != null)
            {
                DisplaySubFoldoutButtons(buttons);
            }
            else
            {
                MGUI.Space18();
            }

            if (isToggled)
            {
                MGUI.Space10();
                DisplayTabContent();
                MGUI.Space4();
            }
            else
            {
                MGUI.Space4();
            }
        }
 public static void MaskProperty(Material mat, MaterialEditor me, bool display, MaterialProperty mask, MaterialProperty scroll)
 {
     if (display)
     {
         me.TexturePropertySingleLine(new GUIContent("Mask Texture"), mask);
         TextureSOScroll(me, mask, scroll, mask.textureValue);
         MGUI.Space4();
     }
 }
        public static bool SmallFoldout(string header, bool display)
        {
            MGUI.Space4();
            float           lw        = EditorGUIUtility.labelWidth - 13;
            GUILayoutOption clickArea = GUILayout.MaxWidth(lw);
            Rect            rect      = GUILayoutUtility.GetRect(0, 18f, clickArea);

            MGUI.SpaceN24();
            header = "    " + header;
            EditorGUILayout.LabelField(header);
            MGUI.Space22();
            return(DoSmallToggle(display, rect));
        }
        public static void Foldout(
            string header, Dictionary <Material, Toggles> foldouts,
            Dictionary <Action, GUIContent> buttons, Material mat,
            MaterialEditor me, Action DisplayTabContent, bool[] errors
            )
        {
            bool isToggled = DisplayErrorFoldoutElements(me, header, foldouts[mat].GetState(header), buttons.Count, 0, errors);

            foldouts[mat].SetState(header, isToggled);

            if (buttons != null)
            {
                DisplayFoldoutButtons(buttons);
            }

            if (isToggled)
            {
                MGUI.Space8();
                DisplayTabContent();
                MGUI.Space4();
            }
        }