Example #1
0
        public void HandleMouseDragEvent(Event e)
        {
            if (_selectionGridSnapSession.IsActive)
            {
                _selectionGridSnapSession.UpdateForMouseMovement();
            }
            else
            if (_selectionGrabSession.IsActive)
            {
                _selectionGrabSession.Update();
                ObjectSelectionGizmos.OnObjectSelectionUpdated();
            }
            else
            if (_objectVertexSnapSession.IsActive)
            {
                e.DisableInSceneView();
                _objectVertexSnapSession.UpdateForMouseMovement();
                ObjectSelectionGizmos.OnObjectSelectionUpdated();
                return;
            }
            else
            {
                SelectionShape.HandleMouseDragEvent(e);

                var mouseDragSelectionUpdateOperation = ObjectSelectionUpdateOperationFactory.Create(ObjectSelectionUpdateOperationType.MouseDrag);
                mouseDragSelectionUpdateOperation.Perform();
            }

            SceneView.RepaintAll();
        }
Example #2
0
        public void HandleMouseButtonDownEvent(Event e)
        {
            if (_object2ObjectSnapSession.IsActive && AllShortcutCombos.Instance.EndSelectionObject2ObjectSnap.IsActive())
            {
                e.DisableInSceneView();
                _object2ObjectSnapSession.End();
                return;
            }

            if (_selectionGridSnapSession.IsActive || _selectionGrabSession.IsActive || _object2ObjectSnapSession.IsActive || _objectVertexSnapSession.IsActive)
            {
                return;
            }
            if (AllShortcutCombos.Instance.SnapXZGridToCursorPickPointOnLeftClick_Selection.IsActive() && e.InvolvesLeftMouseButton())
            {
                e.DisableInSceneView();

                ObjectSnapping.Get().SnapXZGridToCursorPickPoint(e.clickCount == 2);
                return;
            }

            if (Mirror.IsInteractionSessionActive && e.InvolvesLeftMouseButton())
            {
                e.DisableInSceneView();
                Mirror.EndInteractionSession();
                return;
            }

            if (e.InvolvesLeftMouseButton() && NumberOfSelectedObjects != 0 &&
                !SelectionShape.IsVisible() && AllShortcutCombos.Instance.ReplacePrefabsForSelectedObjects_Scene.IsActive() &&
                !Mirror.IsInteractionSessionActive)
            {
                e.DisableInSceneView();
                UndoEx.RecordForToolAction(this);
                List <GameObject> newObjects = ObjectSelectionActions.ReplaceSelectedObjectsPrefabOnMouseClick();
                if (newObjects.Count != 0)
                {
                    AddGameObjectCollectionToSelection(newObjects);
                }

                return;
            }

            SelectionShape.HandleMouseButtonDownEvent(e);
            if (CanPerformClickSelectionUpdateOperation())
            {
                var clickSelectionUpdateOperation = ObjectSelectionUpdateOperationFactory.Create(ObjectSelectionUpdateOperationType.Click);
                clickSelectionUpdateOperation.Perform();

                SceneView.RepaintAll();
            }
        }
        public void HandleMouseDragEvent(Event e)
        {
            if (_selectionSnapSession.IsActive)
            {
                _selectionSnapSession.UpdateForMouseMovement();
            }
            else
            if (_selectionGrabSession.IsActive)
            {
                _selectionGrabSession.Update();
                ObjectSelectionTransformGizmoSystem.OnObjectSelectionUpdated();
            }
            else
            {
                SelectionShape.HandleMouseDragEvent(e);

                var mouseDragSelectionUpdateOperation = ObjectSelectionUpdateOperationFactory.Create(ObjectSelectionUpdateOperationType.MouseDrag);
                mouseDragSelectionUpdateOperation.Perform();
            }

            SceneView.RepaintAll();
        }