Ejemplo n.º 1
0
        /// <summary>
        /// Draws the section header with the foldout style
        /// </summary>
        /// <param name="bCol">original background color</param>
        private void drawFoldoutSection(Color bCol)
        {
            TSFunctions.DrawLine(new Color(0.35f, 0.35f, 0.35f, 1), 1, 0);
            GUI.backgroundColor = bCol;

            Rect r = EditorGUILayout.BeginHorizontal();

            isOpen = EditorGUILayout.Toggle(isOpen, EditorStyles.foldout, GUILayout.MaxWidth(15.0f));
            EditorGUILayout.LabelField(sectionTitle, TSConstants.Styles.sectionTitle);
            isEnabled = EditorGUILayout.Toggle(isEnabled, TSConstants.Styles.deleteStyle, GUILayout.MaxWidth(15.0f));
            isOpen    = GUI.Toggle(r, isOpen, GUIContent.none, new GUIStyle());
            EditorGUILayout.EndHorizontal();
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Draws the list of sections
        /// </summary>
        /// <param name="materialEditor">Material editor provided by the material inspector window</param>
        public void DrawSectionsList(MaterialEditor materialEditor)
        {
            ReorderSections();

            foreach (OrderedSection section in sections)
            {
                if (!HasMixedIndexZero(section))
                {
                    section.DrawSection(materialEditor);
                }
            }

            if (sectionStyle == SectionStyle.Foldout)
            {
                TSFunctions.DrawLine(new Color(0.35f, 0.35f, 0.35f, 1), 1, 0);
                GUILayout.Space(10);
            }
        }