ButtonMouseDown() static private méthode

static private ButtonMouseDown ( GUIContent content, FocusType focusType, GUIStyle style ) : bool
content UnityEngine.GUIContent
focusType FocusType
style UnityEngine.GUIStyle
Résultat bool
        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 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();
        }
        private void VertexEditing(Object unused, SceneView sceneView)
        {
            GUILayoutOption[] options = new GUILayoutOption[] { GUILayout.Width(300f) };
            GUILayout.BeginVertical(options);
            GUILayout.BeginHorizontal(new GUILayoutOption[0]);
            GUILayoutOption[] optionArray2 = new GUILayoutOption[] { GUILayout.ExpandWidth(false) };
            GUILayout.Label("Visualization: ", optionArray2);
            GUILayout.BeginVertical(new GUILayoutOption[0]);
            if (EditorGUILayout.ButtonMouseDown(this.GetModeString(this.drawMode), FocusType.Passive, EditorStyles.toolbarDropDown, new GUILayoutOption[0]))
            {
                Rect        last = GUILayoutUtility.topLevel.GetLast();
                GenericMenu menu = new GenericMenu();
                menu.AddItem(this.GetModeString(DrawMode.MaxDistance), this.drawMode == DrawMode.MaxDistance, new GenericMenu.MenuFunction(this.VisualizationMenuSetMaxDistanceMode));
                menu.AddItem(this.GetModeString(DrawMode.CollisionSphereDistance), this.drawMode == DrawMode.CollisionSphereDistance, new GenericMenu.MenuFunction(this.VisualizationMenuSetCollisionSphereMode));
                menu.AddSeparator(string.Empty);
                menu.AddItem(new GUIContent("Manipulate Backfaces"), this.state.ManipulateBackfaces, new GenericMenu.MenuFunction(this.VisualizationMenuToggleManipulateBackfaces));
                menu.DropDown(last);
            }
            GUILayout.BeginHorizontal(new GUILayoutOption[0]);
            GUILayoutOption[] optionArray3 = new GUILayoutOption[] { GUILayout.ExpandWidth(false) };
            GUILayout.Label(this.m_MinVisualizedValue[(int)this.drawMode].ToString(), optionArray3);
            this.DrawColorBox(s_ColorTexture, Color.clear);
            GUILayoutOption[] optionArray4 = new GUILayoutOption[] { GUILayout.ExpandWidth(false) };
            GUILayout.Label(this.m_MaxVisualizedValue[(int)this.drawMode].ToString(), optionArray4);
            GUILayout.Label("Unconstrained:", new GUILayoutOption[0]);
            GUILayout.Space(-24f);
            GUILayoutOption[] optionArray5 = new GUILayoutOption[] { GUILayout.Width(20f) };
            GUILayout.BeginHorizontal(optionArray5);
            this.DrawColorBox(null, Color.black);
            GUILayout.EndHorizontal();
            GUILayout.EndHorizontal();
            GUILayout.EndVertical();
            GUILayout.EndHorizontal();
            GUILayout.BeginVertical("Box", new GUILayoutOption[0]);
            if (Tools.current != Tool.None)
            {
                this.state.ToolMode = ~ToolMode.Select;
            }
            ToolMode toolMode = this.state.ToolMode;

            this.state.ToolMode = (ToolMode)GUILayout.Toolbar((int)this.state.ToolMode, s_ToolIcons, new GUILayoutOption[0]);
            if (this.state.ToolMode != toolMode)
            {
                GUIUtility.keyboardControl = 0;
                SceneView.RepaintAll();
                this.SetupSelectionMeshColors();
                this.SetupSelectedMeshColors();
            }
            switch (this.state.ToolMode)
            {
            case ToolMode.Select:
                Tools.current = Tool.None;
                this.SelectionGUI();
                break;

            case ToolMode.Paint:
                Tools.current = Tool.None;
                this.PaintGUI();
                break;
            }
            GUILayout.EndVertical();
            if (!this.IsConstrained())
            {
                EditorGUILayout.HelpBox("No constraints have been set up, so the cloth will move freely. Set up vertex constraints here to restrict it.", MessageType.Info);
            }
            GUILayout.EndVertical();
            GUILayout.Space(-4f);
        }