Ejemplo n.º 1
0
        void ShowMaterials()
        {
            GUI.Box(EditorGUI.IndentedRect(new Rect(currentPosition.x, currentPosition.y, currentPosition.width, (lineHeight + 2) * materialsProperty.arraySize)), "");
            currentPosition.y += 2;

            for (int i = 0; i < materialsProperty.arraySize; i++)
            {
                currentMaterial = renderOptions.materials[i];

                CustomEditorBase.Reorderable(materialsProperty, i, true, EditorGUI.IndentedRect(currentPosition), OnMaterialReorder);
                ShowMaterial();
            }
        }
Ejemplo n.º 2
0
        void ShowMaterials(string category, List <Material> materialGroup)
        {
            GUIStyle categoryStyle = new GUIStyle("boldLabel");

            categoryStyle.fontSize = 16;
            EditorGUILayout.LabelField(category, categoryStyle, GUILayout.Height(24));

            float labelWidth = EditorGUIUtility.labelWidth;

            EditorGUIUtility.labelWidth = 149;
            EditorGUI.indentLevel      += 1;

            EditorGUILayout.LabelField(GUIContent.none, new GUIStyle("RL DragHandle"), GUILayout.Height(4));

            EditorGUILayout.BeginHorizontal();

            EditorGUILayout.LabelField("Group", new GUIStyle("boldLabel"), GUILayout.Width(100));
            EditorGUILayout.LabelField(" ", new GUIStyle("boldLabel"), GUILayout.Width(24));
            EditorGUILayout.LabelField("Name                        Queue", new GUIStyle("boldLabel"));

            EditorGUILayout.EndHorizontal();

            EditorGUILayout.LabelField(GUIContent.none, new GUIStyle("RL DragHandle"), GUILayout.Height(4));

            for (int i = 0; i < materialGroup.Count; i++)
            {
                Material material = materialGroup[i];

                EditorGUILayout.BeginHorizontal();

                GUIStyle style = new GUIStyle("label");
                style.fontStyle = FontStyle.Italic;
                style.clipping  = TextClipping.Overflow;
                EditorGUILayout.LabelField(materialGroups[material], style, GUILayout.Width(100));
                EditorGUILayout.LabelField(":", new GUIStyle("boldLabel"), GUILayout.Width(24));
                material.renderQueue = EditorGUILayout.IntField(material.name, material.renderQueue);

                EditorGUILayout.EndHorizontal();

                CustomEditorBase.Reorderable(materialsProperty, materialIndices[material], false, OnMaterialReorder);
            }

            if (materialGroup.Count > 0)
            {
                EditorGUILayout.LabelField(GUIContent.none, new GUIStyle("RL DragHandle"), GUILayout.Height(4));
            }

            EditorGUI.indentLevel      -= 1;
            EditorGUIUtility.labelWidth = labelWidth;
        }