UnityEditor.ClothInspector.SelectionPreSceneGUI C# (CSharp) Méthode

SelectionPreSceneGUI() private méthode

private SelectionPreSceneGUI ( int id ) : void
id int
Résultat void
        private void SelectionPreSceneGUI(int id)
        {
            Event current = Event.current;
            switch (current.GetTypeForControl(id))
            {
                case EventType.MouseDown:
                    if (((!current.alt && !current.control) && !current.command) && (current.button == 0))
                    {
                        GUIUtility.hotControl = id;
                        int mouseVertex = this.GetMouseVertex(current);
                        if (mouseVertex != -1)
                        {
                            if (current.shift)
                            {
                                this.m_Selection[mouseVertex] = !this.m_Selection[mouseVertex];
                            }
                            else
                            {
                                for (int i = 0; i < this.m_Selection.Length; i++)
                                {
                                    this.m_Selection[i] = false;
                                }
                                this.m_Selection[mouseVertex] = true;
                            }
                            this.m_DidSelect = true;
                            this.SetupSelectedMeshColors();
                            base.Repaint();
                        }
                        else
                        {
                            this.m_DidSelect = false;
                        }
                        this.m_SelectStartPoint = current.mousePosition;
                        current.Use();
                        return;
                    }
                    return;

                case EventType.MouseUp:
                    if ((GUIUtility.hotControl == id) && (current.button == 0))
                    {
                        GUIUtility.hotControl = 0;
                        if (!this.m_RectSelecting)
                        {
                            if (!this.m_DidSelect && ((!current.alt && !current.control) && !current.command))
                            {
                                ClothSkinningCoefficient[] coefficients = this.cloth.coefficients;
                                for (int j = 0; j < coefficients.Length; j++)
                                {
                                    this.m_Selection[j] = false;
                                }
                            }
                        }
                        else
                        {
                            EditorApplication.modifierKeysChanged = (EditorApplication.CallbackFunction) Delegate.Remove(EditorApplication.modifierKeysChanged, new EditorApplication.CallbackFunction(this.SendCommandsOnModifierKeys));
                            this.m_RectSelecting = false;
                            this.RectSelectionModeFromEvent();
                            this.ApplyRectSelection();
                        }
                        GUIUtility.keyboardControl = 0;
                        this.SetupSelectedMeshColors();
                        SceneView.RepaintAll();
                    }
                    return;

                case EventType.MouseDrag:
                    if (GUIUtility.hotControl == id)
                    {
                        if (!this.m_RectSelecting)
                        {
                            Vector2 vector = current.mousePosition - this.m_SelectStartPoint;
                            if ((vector.magnitude > 2f) && ((!current.alt && !current.control) && !current.command))
                            {
                                EditorApplication.modifierKeysChanged = (EditorApplication.CallbackFunction) Delegate.Combine(EditorApplication.modifierKeysChanged, new EditorApplication.CallbackFunction(this.SendCommandsOnModifierKeys));
                                this.m_RectSelecting = true;
                                this.RectSelectionModeFromEvent();
                                this.SetupSelectedMeshColors();
                            }
                        }
                        if (this.m_RectSelecting)
                        {
                            this.m_SelectMousePoint = new Vector2(Mathf.Max(current.mousePosition.x, 0f), Mathf.Max(current.mousePosition.y, 0f));
                            if (this.RectSelectionModeFromEvent() || this.UpdateRectSelection())
                            {
                                this.SetupSelectedMeshColors();
                            }
                            current.Use();
                        }
                    }
                    return;

                case EventType.ExecuteCommand:
                    if ((this.m_RectSelecting && (current.commandName == "ModifierKeysChanged")) && (this.RectSelectionModeFromEvent() || this.UpdateRectSelection()))
                    {
                        this.SetupSelectedMeshColors();
                    }
                    return;
            }
        }