public override void OnInspectorGUI()
 {
   AudioMixerDrawUtils.InitStyles();
   if (this.m_EffectView == null)
     this.m_EffectView = new AudioMixerEffectView();
   this.m_EffectView.OnGUI(this.target as AudioMixerGroupController);
 }
        public void DoEffectGUI(int effectIndex, AudioMixerGroupController group, List <AudioMixerGroupController> allGroups, Dictionary <AudioMixerEffectController, AudioMixerGroupController> effectMap, ref int highlightEffectIndex)
        {
            Event current = Event.current;
            AudioMixerController       controller = group.controller;
            AudioMixerEffectController audioMixerEffectController = group.effects[effectIndex];

            MixerParameterDefinition[] effectParameters = MixerEffectDefinitions.GetEffectParameters(audioMixerEffectController.effectName);
            Rect      effectRect     = EditorGUILayout.BeginVertical(new GUILayoutOption[0]);
            bool      flag           = effectRect.Contains(current.mousePosition);
            EventType typeForControl = current.GetTypeForControl(this.m_EffectDragging.dragControlID);

            if (typeForControl == EventType.MouseMove && flag && highlightEffectIndex != effectIndex)
            {
                highlightEffectIndex = effectIndex;
                AudioMixerUtility.RepaintAudioMixerAndInspectors();
            }
            Rect  rect     = GUILayoutUtility.GetRect(1f, 17f);
            Rect  rect2    = new Rect(rect.x + 6f, rect.y + 5f, 6f, 6f);
            Rect  position = new Rect(rect.x + 8f + 6f, rect.y, rect.width - 8f - 6f - 14f - 5f, rect.height);
            Rect  rect3    = new Rect(position.xMax, rect.y, 14f, 14f);
            Rect  rect4    = new Rect(rect.x, rect.y, rect.width - 14f - 5f, rect.height);
            bool  flag2    = EditorPrefs.GetBool(AudioMixerGroupEditor.kPrefKeyForShowCpuUsage, false) && EditorUtility.audioProfilingEnabled;
            float num      = (!EditorGUIUtility.isProSkin) ? 1f : 0.1f;
            Color color    = new Color(num, num, num, 0.2f);
            Color color2   = GUI.color;

            GUI.color = color;
            GUI.DrawTexture(rect, EditorGUIUtility.whiteTexture);
            GUI.color = color2;
            Color effectColor = AudioMixerDrawUtils.GetEffectColor(audioMixerEffectController);

            EditorGUI.DrawRect(rect2, effectColor);
            GUI.Label(position, (!flag2) ? audioMixerEffectController.effectName : (audioMixerEffectController.effectName + string.Format(AudioMixerEffectView.Texts.cpuFormatString, audioMixerEffectController.GetCPUUsage(controller))), EditorStyles.boldLabel);
            if (EditorGUI.ButtonMouseDown(rect3, EditorGUI.GUIContents.titleSettingsIcon, FocusType.Passive, EditorStyles.inspectorTitlebarText))
            {
                AudioMixerEffectView.ShowEffectContextMenu(group, audioMixerEffectController, effectIndex, controller, rect3);
            }
            if (current.type == EventType.ContextClick && rect.Contains(current.mousePosition))
            {
                AudioMixerEffectView.ShowEffectContextMenu(group, audioMixerEffectController, effectIndex, controller, new Rect(current.mousePosition.x, rect.y, 1f, rect.height));
                current.Use();
            }
            if (typeForControl == EventType.Repaint)
            {
                EditorGUIUtility.AddCursorRect(rect4, MouseCursor.ResizeVertical, this.m_EffectDragging.dragControlID);
            }
            using (new EditorGUI.DisabledScope(audioMixerEffectController.bypass || group.bypassEffects))
            {
                EditorGUILayout.BeginVertical(EditorStyles.inspectorDefaultMargins, new GUILayoutOption[0]);
                if (audioMixerEffectController.IsAttenuation())
                {
                    EditorGUILayout.BeginVertical(new GUILayoutOption[0]);
                    float valueForVolume = group.GetValueForVolume(controller, controller.TargetSnapshot);
                    if (AudioMixerEffectGUI.Slider(AudioMixerEffectView.Texts.volume, ref valueForVolume, 1f, 1f, AudioMixerEffectView.Texts.dB, AudioMixerController.kMinVolume, AudioMixerController.GetMaxVolume(), controller, new AudioGroupParameterPath(group, group.GetGUIDForVolume()), new GUILayoutOption[0]))
                    {
                        Undo.RecordObject(controller.TargetSnapshot, "Change Volume Fader");
                        group.SetValueForVolume(controller, controller.TargetSnapshot, valueForVolume);
                        AudioMixerUtility.RepaintAudioMixerAndInspectors();
                    }
                    float[] array  = new float[9];
                    float[] array2 = new float[9];
                    int     num2   = group.controller.GetGroupVUInfo(group.groupID, true, ref array, ref array2);
                    if (current.type == EventType.Layout)
                    {
                        this.m_LastNumChannels = num2;
                    }
                    else
                    {
                        if (num2 != this.m_LastNumChannels)
                        {
                            HandleUtility.Repaint();
                        }
                        num2 = this.m_LastNumChannels;
                    }
                    GUILayout.Space(4f);
                    for (int i = 0; i < num2; i++)
                    {
                        float value = 1f - AudioMixerController.VolumeToScreenMapping(Mathf.Clamp(array[i], AudioMixerController.kMinVolume, AudioMixerController.GetMaxVolume()), 1f, true);
                        float num3  = 1f - AudioMixerController.VolumeToScreenMapping(Mathf.Clamp(array2[i], AudioMixerController.kMinVolume, AudioMixerController.GetMaxVolume()), 1f, true);
                        EditorGUILayout.VUMeterHorizontal(value, num3, new GUILayoutOption[]
                        {
                            GUILayout.Height(10f)
                        });
                        if (!EditorApplication.isPlaying && num3 > 0f)
                        {
                            AudioMixerUtility.RepaintAudioMixerAndInspectors();
                        }
                    }
                    GUILayout.Space(4f);
                    EditorGUILayout.EndVertical();
                }
                if (audioMixerEffectController.IsSend())
                {
                    GUIContent buttonContent = (!(audioMixerEffectController.sendTarget == null)) ? GUIContent.Temp(audioMixerEffectController.GetSendTargetDisplayString(effectMap)) : AudioMixerEffectView.Texts.none;
                    Rect       buttonRect;
                    if (AudioMixerEffectGUI.PopupButton(AudioMixerEffectView.Texts.bus, buttonContent, EditorStyles.popup, out buttonRect, new GUILayoutOption[0]))
                    {
                        AudioMixerEffectView.ShowBusPopupMenu(effectIndex, group, allGroups, effectMap, audioMixerEffectController, buttonRect);
                    }
                    if (audioMixerEffectController.sendTarget != null)
                    {
                        float valueForMixLevel = audioMixerEffectController.GetValueForMixLevel(controller, controller.TargetSnapshot);
                        if (AudioMixerEffectGUI.Slider(AudioMixerEffectView.Texts.sendLevel, ref valueForMixLevel, 1f, 1f, AudioMixerEffectView.Texts.dB, AudioMixerController.kMinVolume, AudioMixerController.kMaxEffect, controller, new AudioEffectParameterPath(group, audioMixerEffectController, audioMixerEffectController.GetGUIDForMixLevel()), new GUILayoutOption[0]))
                        {
                            Undo.RecordObject(controller.TargetSnapshot, "Change Send Level");
                            audioMixerEffectController.SetValueForMixLevel(controller, controller.TargetSnapshot, valueForMixLevel);
                            AudioMixerUtility.RepaintAudioMixerAndInspectors();
                        }
                    }
                }
                if (MixerEffectDefinitions.EffectCanBeSidechainTarget(audioMixerEffectController))
                {
                    bool flag3 = false;
                    foreach (AudioMixerGroupController current2 in allGroups)
                    {
                        AudioMixerEffectController[] effects = current2.effects;
                        for (int j = 0; j < effects.Length; j++)
                        {
                            AudioMixerEffectController audioMixerEffectController2 = effects[j];
                            if (audioMixerEffectController2.IsSend() && audioMixerEffectController2.sendTarget == audioMixerEffectController)
                            {
                                flag3 = true;
                                break;
                            }
                            if (flag3)
                            {
                                break;
                            }
                        }
                        if (flag3)
                        {
                            break;
                        }
                    }
                    if (!flag3)
                    {
                        GUILayout.Label(new GUIContent("No Send sources connected.", EditorGUIUtility.warningIcon), new GUILayoutOption[0]);
                    }
                }
                if (audioMixerEffectController.enableWetMix && !audioMixerEffectController.IsReceive() && !audioMixerEffectController.IsDuckVolume() && !audioMixerEffectController.IsAttenuation() && !audioMixerEffectController.IsSend())
                {
                    float valueForMixLevel2 = audioMixerEffectController.GetValueForMixLevel(controller, controller.TargetSnapshot);
                    if (AudioMixerEffectGUI.Slider(AudioMixerEffectView.Texts.wet, ref valueForMixLevel2, 1f, 1f, AudioMixerEffectView.Texts.dB, AudioMixerController.kMinVolume, AudioMixerController.kMaxEffect, controller, new AudioEffectParameterPath(group, audioMixerEffectController, audioMixerEffectController.GetGUIDForMixLevel()), new GUILayoutOption[0]))
                    {
                        Undo.RecordObject(controller.TargetSnapshot, "Change Mix Level");
                        audioMixerEffectController.SetValueForMixLevel(controller, controller.TargetSnapshot, valueForMixLevel2);
                        AudioMixerUtility.RepaintAudioMixerAndInspectors();
                    }
                }
                bool flag4 = true;
                if (this.m_CustomEffectGUIs.ContainsKey(audioMixerEffectController.effectName))
                {
                    IAudioEffectPluginGUI audioEffectPluginGUI = this.m_CustomEffectGUIs[audioMixerEffectController.effectName];
                    this.m_SharedPlugin.m_Controller = controller;
                    this.m_SharedPlugin.m_Effect     = audioMixerEffectController;
                    this.m_SharedPlugin.m_ParamDefs  = effectParameters;
                    flag4 = audioEffectPluginGUI.OnGUI(this.m_SharedPlugin);
                }
                if (flag4)
                {
                    MixerParameterDefinition[] array3 = effectParameters;
                    for (int k = 0; k < array3.Length; k++)
                    {
                        MixerParameterDefinition mixerParameterDefinition = array3[k];
                        float valueForParameter = audioMixerEffectController.GetValueForParameter(controller, controller.TargetSnapshot, mixerParameterDefinition.name);
                        if (AudioMixerEffectGUI.Slider(GUIContent.Temp(mixerParameterDefinition.name, mixerParameterDefinition.description), ref valueForParameter, mixerParameterDefinition.displayScale, mixerParameterDefinition.displayExponent, mixerParameterDefinition.units, mixerParameterDefinition.minRange, mixerParameterDefinition.maxRange, controller, new AudioEffectParameterPath(group, audioMixerEffectController, audioMixerEffectController.GetGUIDForParameter(mixerParameterDefinition.name)), new GUILayoutOption[0]))
                        {
                            Undo.RecordObject(controller.TargetSnapshot, "Change " + mixerParameterDefinition.name);
                            audioMixerEffectController.SetValueForParameter(controller, controller.TargetSnapshot, mixerParameterDefinition.name, valueForParameter);
                        }
                    }
                    if (effectParameters.Length > 0)
                    {
                        GUILayout.Space(6f);
                    }
                }
            }
            this.m_EffectDragging.HandleDragElement(effectIndex, effectRect, rect4, group, allGroups);
            EditorGUILayout.EndVertical();
            EditorGUILayout.EndVertical();
            AudioMixerDrawUtils.DrawSplitter();
        }
        public void OnGUI(AudioMixerGroupController group)
        {
            if (group == null)
            {
                return;
            }
            AudioMixerController             controller         = group.controller;
            List <AudioMixerGroupController> allAudioGroupsSlow = controller.GetAllAudioGroupsSlow();
            Dictionary <AudioMixerEffectController, AudioMixerGroupController> dictionary = new Dictionary <AudioMixerEffectController, AudioMixerGroupController>();

            foreach (AudioMixerGroupController current in allAudioGroupsSlow)
            {
                AudioMixerEffectController[] effects = current.effects;
                for (int i = 0; i < effects.Length; i++)
                {
                    AudioMixerEffectController key = effects[i];
                    dictionary[key] = current;
                }
            }
            Rect totalRect = EditorGUILayout.BeginVertical(new GUILayoutOption[0]);

            if (EditorApplication.isPlaying)
            {
                GUILayout.BeginHorizontal(new GUILayoutOption[0]);
                GUILayout.FlexibleSpace();
                EditorGUI.BeginChangeCheck();
                GUILayout.Toggle(AudioSettings.editingInPlaymode, AudioMixerEffectView.Texts.editInPlaymode, EditorStyles.miniButton, new GUILayoutOption[]
                {
                    GUILayout.Width(120f)
                });
                if (EditorGUI.EndChangeCheck())
                {
                    AudioSettings.editingInPlaymode = !AudioSettings.editingInPlaymode;
                }
                GUILayout.FlexibleSpace();
                GUILayout.EndHorizontal();
            }
            using (new EditorGUI.DisabledScope(!AudioMixerController.EditingTargetSnapshot()))
            {
                if (group != this.m_PrevGroup)
                {
                    this.m_PrevGroup = group;
                    controller.m_HighlightEffectIndex = -1;
                    AudioMixerUtility.RepaintAudioMixerAndInspectors();
                }
                AudioMixerEffectView.DoInitialModule(group, controller, allAudioGroupsSlow);
                for (int j = 0; j < group.effects.Length; j++)
                {
                    this.DoEffectGUI(j, group, allAudioGroupsSlow, dictionary, ref controller.m_HighlightEffectIndex);
                }
                this.m_EffectDragging.HandleDragging(totalRect, group, controller);
                GUILayout.Space(10f);
                EditorGUILayout.BeginHorizontal(new GUILayoutOption[0]);
                GUILayout.FlexibleSpace();
                if (EditorGUILayout.ButtonMouseDown(AudioMixerEffectView.Texts.addEffect, FocusType.Passive, GUISkin.current.button, new GUILayoutOption[0]))
                {
                    GenericMenu genericMenu            = new GenericMenu();
                    Rect        last                   = GUILayoutUtility.topLevel.GetLast();
                    AudioMixerGroupController[] groups = new AudioMixerGroupController[]
                    {
                        group
                    };
                    AudioMixerChannelStripView.AddEffectItemsToMenu(controller, groups, group.effects.Length, string.Empty, genericMenu);
                    genericMenu.DropDown(last);
                }
                EditorGUILayout.EndHorizontal();
            }
            EditorGUILayout.EndVertical();
        }
        public void OnGUI(AudioMixerGroupController group)
        {
            if ((UnityEngine.Object)group == (UnityEngine.Object)null)
            {
                return;
            }
            AudioMixerController             controller         = group.controller;
            List <AudioMixerGroupController> allAudioGroupsSlow = controller.GetAllAudioGroupsSlow();
            Dictionary <AudioMixerEffectController, AudioMixerGroupController> effectMap = new Dictionary <AudioMixerEffectController, AudioMixerGroupController>();

            using (List <AudioMixerGroupController> .Enumerator enumerator = allAudioGroupsSlow.GetEnumerator())
            {
                while (enumerator.MoveNext())
                {
                    AudioMixerGroupController current = enumerator.Current;
                    foreach (AudioMixerEffectController effect in current.effects)
                    {
                        effectMap[effect] = current;
                    }
                }
            }
            Rect totalRect = EditorGUILayout.BeginVertical();

            if (EditorApplication.isPlaying)
            {
                GUILayout.BeginHorizontal();
                GUILayout.FlexibleSpace();
                EditorGUI.BeginChangeCheck();
                GUILayout.Toggle((AudioSettings.editingInPlaymode ? 1 : 0) != 0, AudioMixerEffectView.Texts.editInPlaymode, EditorStyles.miniButton, new GUILayoutOption[1]
                {
                    GUILayout.Width(120f)
                });
                if (EditorGUI.EndChangeCheck())
                {
                    AudioSettings.editingInPlaymode = !AudioSettings.editingInPlaymode;
                }
                GUILayout.FlexibleSpace();
                GUILayout.EndHorizontal();
            }
            EditorGUI.BeginDisabledGroup(!AudioMixerController.EditingTargetSnapshot());
            if ((UnityEngine.Object)group != (UnityEngine.Object) this.m_PrevGroup)
            {
                this.m_PrevGroup = group;
                controller.m_HighlightEffectIndex = -1;
                AudioMixerUtility.RepaintAudioMixerAndInspectors();
            }
            double num = (double)AudioMixerEffectView.DoInitialModule(group, controller, allAudioGroupsSlow);

            for (int effectIndex = 0; effectIndex < group.effects.Length; ++effectIndex)
            {
                this.DoEffectGUI(effectIndex, group, allAudioGroupsSlow, effectMap, ref controller.m_HighlightEffectIndex);
            }
            this.m_EffectDragging.HandleDragging(totalRect, group, controller);
            GUILayout.Space(10f);
            EditorGUILayout.BeginHorizontal();
            GUILayout.FlexibleSpace();
            if (EditorGUILayout.ButtonMouseDown(AudioMixerEffectView.Texts.addEffect, FocusType.Passive, GUISkin.current.button))
            {
                GenericMenu pm   = new GenericMenu();
                Rect        last = GUILayoutUtility.topLevel.GetLast();
                AudioMixerGroupController[] groups = new AudioMixerGroupController[1] {
                    group
                };
                AudioMixerChannelStripView.AddEffectItemsToMenu(controller, groups, group.effects.Length, string.Empty, pm);
                pm.DropDown(last);
            }
            EditorGUILayout.EndHorizontal();
            EditorGUI.EndDisabledGroup();
            EditorGUILayout.EndVertical();
        }
        public void DoEffectGUI(int effectIndex, AudioMixerGroupController group, List <AudioMixerGroupController> allGroups, Dictionary <AudioMixerEffectController, AudioMixerGroupController> effectMap, ref int highlightEffectIndex)
        {
            Event current = Event.current;
            AudioMixerController       controller = group.controller;
            AudioMixerEffectController effect1    = group.effects[effectIndex];

            MixerParameterDefinition[] effectParameters = MixerEffectDefinitions.GetEffectParameters(effect1.effectName);
            Rect      effectRect     = EditorGUILayout.BeginVertical();
            bool      flag1          = effectRect.Contains(current.mousePosition);
            EventType typeForControl = current.GetTypeForControl(this.m_EffectDragging.dragControlID);

            if (typeForControl == EventType.MouseMove && flag1 && highlightEffectIndex != effectIndex)
            {
                highlightEffectIndex = effectIndex;
                AudioMixerUtility.RepaintAudioMixerAndInspectors();
            }
            Rect  rect1    = GUILayoutUtility.GetRect(1f, 17f);
            Rect  rect2    = new Rect(rect1.x + 6f, rect1.y + 5f, 6f, 6f);
            Rect  position = new Rect((float)((double)rect1.x + 8.0 + 6.0), rect1.y, (float)((double)rect1.width - 8.0 - 6.0 - 14.0 - 5.0), rect1.height);
            Rect  rect3    = new Rect(position.xMax, rect1.y, 14f, 14f);
            Rect  rect4    = new Rect(rect1.x, rect1.y, (float)((double)rect1.width - 14.0 - 5.0), rect1.height);
            bool  flag2    = EditorPrefs.GetBool(AudioMixerGroupEditor.kPrefKeyForShowCpuUsage, false) && EditorUtility.audioProfilingEnabled;
            float num1     = !EditorGUIUtility.isProSkin ? 1f : 0.1f;
            Color color1   = new Color(num1, num1, num1, 0.2f);
            Color color2   = GUI.color;

            GUI.color = color1;
            GUI.DrawTexture(rect1, (Texture)EditorGUIUtility.whiteTexture);
            GUI.color = color2;
            Color effectColor = AudioMixerDrawUtils.GetEffectColor(effect1);

            EditorGUI.DrawRect(rect2, effectColor);
            GUI.Label(position, !flag2 ? effect1.effectName : effect1.effectName + string.Format(AudioMixerEffectView.Texts.cpuFormatString, (object)effect1.GetCPUUsage(controller)), EditorStyles.boldLabel);
            if (EditorGUI.ButtonMouseDown(rect3, EditorGUI.GUIContents.titleSettingsIcon, FocusType.Passive, EditorStyles.inspectorTitlebarText))
            {
                AudioMixerEffectView.ShowEffectContextMenu(group, effect1, effectIndex, controller, rect3);
            }
            if (current.type == EventType.ContextClick && rect1.Contains(current.mousePosition))
            {
                AudioMixerEffectView.ShowEffectContextMenu(group, effect1, effectIndex, controller, new Rect(current.mousePosition.x, rect1.y, 1f, rect1.height));
                current.Use();
            }
            if (typeForControl == EventType.Repaint)
            {
                EditorGUIUtility.AddCursorRect(rect4, MouseCursor.ResizeVertical, this.m_EffectDragging.dragControlID);
            }
            EditorGUI.BeginDisabledGroup(effect1.bypass || group.bypassEffects);
            EditorGUILayout.BeginVertical(EditorStyles.inspectorDefaultMargins, new GUILayoutOption[0]);
            if (effect1.IsAttenuation())
            {
                EditorGUILayout.BeginVertical();
                float valueForVolume = group.GetValueForVolume(controller, controller.TargetSnapshot);
                if (AudioMixerEffectGUI.Slider(AudioMixerEffectView.Texts.volume, ref valueForVolume, 1f, 1f, AudioMixerEffectView.Texts.dB, AudioMixerController.kMinVolume, AudioMixerController.GetMaxVolume(), controller, (AudioParameterPath) new AudioGroupParameterPath(group, group.GetGUIDForVolume())))
                {
                    Undo.RecordObject((UnityEngine.Object)controller.TargetSnapshot, "Change Volume Fader");
                    group.SetValueForVolume(controller, controller.TargetSnapshot, valueForVolume);
                    AudioMixerUtility.RepaintAudioMixerAndInspectors();
                }
                float[] vuLevel = new float[9];
                float[] vuPeak  = new float[9];
                int     num2    = group.controller.GetGroupVUInfo(group.groupID, true, ref vuLevel, ref vuPeak);
                if (current.type == EventType.Layout)
                {
                    this.m_LastNumChannels = num2;
                }
                else
                {
                    if (num2 != this.m_LastNumChannels)
                    {
                        HandleUtility.Repaint();
                    }
                    num2 = this.m_LastNumChannels;
                }
                GUILayout.Space(4f);
                for (int index = 0; index < num2; ++index)
                {
                    float num3 = 1f - AudioMixerController.VolumeToScreenMapping(Mathf.Clamp(vuLevel[index], AudioMixerController.kMinVolume, AudioMixerController.GetMaxVolume()), 1f, true);
                    float peak = 1f - AudioMixerController.VolumeToScreenMapping(Mathf.Clamp(vuPeak[index], AudioMixerController.kMinVolume, AudioMixerController.GetMaxVolume()), 1f, true);
                    EditorGUILayout.VUMeterHorizontal(num3, peak, new GUILayoutOption[1]
                    {
                        GUILayout.Height(10f)
                    });
                    if (!EditorApplication.isPlaying && (double)peak > 0.0)
                    {
                        AudioMixerUtility.RepaintAudioMixerAndInspectors();
                    }
                }
                GUILayout.Space(4f);
                EditorGUILayout.EndVertical();
            }
            if (effect1.IsSend())
            {
                GUIContent buttonContent = !((UnityEngine.Object)effect1.sendTarget == (UnityEngine.Object)null) ? GUIContent.Temp(effect1.GetSendTargetDisplayString(effectMap)) : AudioMixerEffectView.Texts.none;
                Rect       buttonRect;
                if (AudioMixerEffectGUI.PopupButton(AudioMixerEffectView.Texts.bus, buttonContent, EditorStyles.popup, out buttonRect))
                {
                    AudioMixerEffectView.ShowBusPopupMenu(effectIndex, group, allGroups, effectMap, effect1, buttonRect);
                }
                if ((UnityEngine.Object)effect1.sendTarget != (UnityEngine.Object)null)
                {
                    float valueForMixLevel = effect1.GetValueForMixLevel(controller, controller.TargetSnapshot);
                    if (AudioMixerEffectGUI.Slider(AudioMixerEffectView.Texts.sendLevel, ref valueForMixLevel, 1f, 1f, AudioMixerEffectView.Texts.dB, AudioMixerController.kMinVolume, AudioMixerController.kMaxEffect, controller, (AudioParameterPath) new AudioEffectParameterPath(group, effect1, effect1.GetGUIDForMixLevel())))
                    {
                        Undo.RecordObject((UnityEngine.Object)controller.TargetSnapshot, "Change Send Level");
                        effect1.SetValueForMixLevel(controller, controller.TargetSnapshot, valueForMixLevel);
                        AudioMixerUtility.RepaintAudioMixerAndInspectors();
                    }
                }
            }
            if (MixerEffectDefinitions.EffectCanBeSidechainTarget(effect1))
            {
                bool flag3 = false;
                using (List <AudioMixerGroupController> .Enumerator enumerator = allGroups.GetEnumerator())
                {
                    while (enumerator.MoveNext())
                    {
                        foreach (AudioMixerEffectController effect2 in enumerator.Current.effects)
                        {
                            if (effect2.IsSend() && (UnityEngine.Object)effect2.sendTarget == (UnityEngine.Object)effect1)
                            {
                                flag3 = true;
                                break;
                            }
                            if (flag3)
                            {
                                break;
                            }
                        }
                        if (flag3)
                        {
                            break;
                        }
                    }
                }
                if (!flag3)
                {
                    GUILayout.Label(new GUIContent("No Send sources connected.", (Texture)EditorGUIUtility.warningIcon));
                }
            }
            if (effect1.enableWetMix && !effect1.IsReceive() && (!effect1.IsDuckVolume() && !effect1.IsAttenuation()) && !effect1.IsSend())
            {
                float valueForMixLevel = effect1.GetValueForMixLevel(controller, controller.TargetSnapshot);
                if (AudioMixerEffectGUI.Slider(AudioMixerEffectView.Texts.wet, ref valueForMixLevel, 1f, 1f, AudioMixerEffectView.Texts.dB, AudioMixerController.kMinVolume, AudioMixerController.kMaxEffect, controller, (AudioParameterPath) new AudioEffectParameterPath(group, effect1, effect1.GetGUIDForMixLevel())))
                {
                    Undo.RecordObject((UnityEngine.Object)controller.TargetSnapshot, "Change Mix Level");
                    effect1.SetValueForMixLevel(controller, controller.TargetSnapshot, valueForMixLevel);
                    AudioMixerUtility.RepaintAudioMixerAndInspectors();
                }
            }
            bool flag4 = true;

            if (this.m_CustomEffectGUIs.ContainsKey(effect1.effectName))
            {
                IAudioEffectPluginGUI customEffectGuI = this.m_CustomEffectGUIs[effect1.effectName];
                this.m_SharedPlugin.m_Controller = controller;
                this.m_SharedPlugin.m_Effect     = effect1;
                this.m_SharedPlugin.m_ParamDefs  = effectParameters;
                flag4 = customEffectGuI.OnGUI((IAudioEffectPlugin)this.m_SharedPlugin);
            }
            if (flag4)
            {
                foreach (MixerParameterDefinition parameterDefinition in effectParameters)
                {
                    float valueForParameter = effect1.GetValueForParameter(controller, controller.TargetSnapshot, parameterDefinition.name);
                    if (AudioMixerEffectGUI.Slider(GUIContent.Temp(parameterDefinition.name, parameterDefinition.description), ref valueForParameter, parameterDefinition.displayScale, parameterDefinition.displayExponent, parameterDefinition.units, parameterDefinition.minRange, parameterDefinition.maxRange, controller, (AudioParameterPath) new AudioEffectParameterPath(group, effect1, effect1.GetGUIDForParameter(parameterDefinition.name))))
                    {
                        Undo.RecordObject((UnityEngine.Object)controller.TargetSnapshot, "Change " + parameterDefinition.name);
                        effect1.SetValueForParameter(controller, controller.TargetSnapshot, parameterDefinition.name, valueForParameter);
                    }
                }
                if (effectParameters.Length > 0)
                {
                    GUILayout.Space(6f);
                }
            }
            EditorGUI.EndDisabledGroup();
            this.m_EffectDragging.HandleDragElement(effectIndex, effectRect, rect4, group, allGroups);
            EditorGUILayout.EndVertical();
            EditorGUILayout.EndVertical();
            AudioMixerDrawUtils.DrawSplitter();
        }