public void Process(Event currentEvent)
        {
            if (currentEvent.type == EventType.mouseDown)
            {
                if (currentEvent.button == 0)
                {
                    if ((!currentEvent.control && currentEvent.shift) || BGCurveSettingsForEditor.LockView)
                    {
                        eventCanceller = new BGEditorUtility.EventCanceller();

                        if (!BGCurveSettingsForEditor.DisableRectangularSelection)
                        {
                            selectionRectangle.On();
                        }
                    }
                }
                else if (currentEvent.button == 1 && selectionRectangle.IsOn)
                {
                    //glitch with right click
                    GUIUtility.hotControl = GUIUtility.GetControlID(FocusType.Passive);
                }
            }
            else if (currentEvent.type == EventType.mouseUp)
            {
                SceneView.RepaintAll();
                selectionRectangle.Off();
                BGEditorUtility.Release(ref eventCanceller);
            }


            selectionRectangle.Process(currentEvent);
        }
Esempio n. 2
0
        public void Process(Event currentEvent)
        {
            if (currentEvent.type == EventType.mouseDown)
            {
                if (currentEvent.button == 0)
                {
                    if ((!currentEvent.control && currentEvent.shift) || BGCurveSettingsForEditor.LockView)
                    {
                        var cancelEvent = Tools.viewTool != ViewTool.FPS && Tools.current != Tool.View /*&& Tools.current != Tool.None*/ && !currentEvent.isKey;
                        if (cancelEvent)
                        {
                            eventCanceller = new BGEditorUtility.EventCanceller();
                        }

                        if (currentEvent.shift && !BGCurveSettingsForEditor.DisableRectangularSelection)
                        {
                            selectionRectangle.On();
                        }
                        else if (cancelEvent)
                        {
                            BGCurveEditor.OverlayMessage.Display("The Scene view is locked.\r\n Set 'Lock View' (in the BGCurve Editor) to false to unlock.");
                        }
                    }
                }
                else if (currentEvent.button == 1 && selectionRectangle.IsOn)
                {
                    //glitch with right click
                    GUIUtility.hotControl = GUIUtility.GetControlID(FocusType.Passive);
                }
            }
            else if (currentEvent.type == EventType.mouseUp)
            {
                SceneView.RepaintAll();
                selectionRectangle.Off();
                BGEditorUtility.Release(ref eventCanceller);
            }


            selectionRectangle.Process(currentEvent);
        }