Exemplo n.º 1
0
        private void OnGUI()
        {
            GUILayout.Label(BaseSettingsStr, EditorStyles.boldLabel);

            index = EasyGUILayout.Tabs(index, ref tabPanelPosition, FormatSelectedGameObjectsStr, ReplaceGameObjectsWithPrefabStr, CategorizingReferencedAssetsStr, ManageRenderQueueStr, FindReferencesInPathStr);

            EditorGUILayout.BeginHorizontal();

            // View Panel Part
            EditorGUILayout.BeginVertical();
            EditorGUI.indentLevel++;
            viewPanelPosition = GUILayout.BeginScrollView(viewPanelPosition);
            OnViewGUI(index);
            GUILayout.EndScrollView();
            EditorGUI.indentLevel--;
            EditorGUILayout.EndVertical();

            // Control Panel Part
            EditorGUILayout.BeginVertical();
            EditorGUI.indentLevel++;
            controlPanelPosition = GUILayout.BeginScrollView(controlPanelPosition);
            OnControlGUI(index);
            GUILayout.EndScrollView();
            EditorGUI.indentLevel--;
            EditorGUILayout.EndVertical();

            EditorGUILayout.EndHorizontal();
        }
Exemplo n.º 2
0
        private void OnViewRenderQueueGUI()
        {
            var mats   = FormatUtility.GetOrderedMaterialsFromActivatedScenes();
            var labels = renderQueueLabels.OrderBy(kvp => kvp.Value).ToDictionary(kvp => kvp.Key, kvp => kvp.Value);

            foreach (var kvp in mats)
            {
                if (!renderQueueFoldouts.ContainsKey(kvp.Key))
                {
                    renderQueueFoldouts.Add(kvp.Key, false);
                }
                DrawRenderQueueLabel(labels, kvp.Key.renderQueue);
                EditorGUILayout.BeginHorizontal();
                Rect position;
                renderQueueFoldouts[kvp.Key] = EasyGUILayout.Foldout(renderQueueFoldouts[kvp.Key], GUIContent.none, 25, out position);
                EditorGUI.ObjectField(position, kvp.Key, typeof(Material), false);
                EditorGUILayout.EndHorizontal();
                if (renderQueueFoldouts[kvp.Key])
                {
                    EditorGUI.indentLevel += 2;
                    for (int i = 0; i < kvp.Value.Count; i++)
                    {
                        EditorGUILayout.ObjectField(string.Format(ElementStr, i), kvp.Value[i], typeof(GameObject), false);
                    }
                    EditorGUI.indentLevel -= 2;
                }
            }
        }