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();
            }
        }