private static void SaveObjectSelectionSettings(XmlTextWriter xmlWriter, Octave3DConfigSaveLoadSettings saveSettings)
        {
            if (saveSettings.ObjectSelectionSettings)
            {
                ObjectSelectionSettings objectSelectionSettings = ObjectSelectionSettings.Get();

                xmlWriter.WriteNewLine(1);
                xmlWriter.WriteStartElement(Octave3DConfigXMLInfo.ObjectSelectionSettingsNode);

                xmlWriter.WriteNewLine(2);
                xmlWriter.WriteStartElement(Octave3DConfigXMLInfo.ObjectSelectionAllowPartialOverlapNode);
                xmlWriter.WriteString(objectSelectionSettings.AllowPartialOverlap.ToString());
                xmlWriter.WriteEndElement();

                xmlWriter.WriteNewLine(2);
                xmlWriter.WriteStartElement(Octave3DConfigXMLInfo.AttachMirroredSelectedObjectsToActiveGroupNodeNode);
                xmlWriter.WriteString(objectSelectionSettings.AttachMirroredObjectsToActiveObjectGroup.ToString());
                xmlWriter.WriteEndElement();

                xmlWriter.WriteNewLine(2);
                xmlWriter.WriteStartElement(Octave3DConfigXMLInfo.ObjectSelectionShapeTypeNode);
                xmlWriter.WriteString(objectSelectionSettings.SelectionShapeType.ToString());
                xmlWriter.WriteEndElement();

                xmlWriter.WriteNewLine(2);
                xmlWriter.WriteStartElement(Octave3DConfigXMLInfo.ObjectSelectionUpdateModeNode);
                xmlWriter.WriteString(objectSelectionSettings.SelectionUpdateMode.ToString());
                xmlWriter.WriteEndElement();

                xmlWriter.WriteNewLine(2);
                xmlWriter.WriteStartElement(Octave3DConfigXMLInfo.ObjectSelectionModeNode);
                xmlWriter.WriteString(objectSelectionSettings.SelectionMode.ToString());
                xmlWriter.WriteEndElement();

                xmlWriter.WriteNewLine(2);
                xmlWriter.WriteStartElement(Octave3DConfigXMLInfo.ObjectSelectionPaint_ShapePixelWidthNode);
                xmlWriter.WriteString(objectSelectionSettings.PaintModeSettings.SelectionShapeWidthInPixels.ToString());
                xmlWriter.WriteEndElement();

                xmlWriter.WriteNewLine(2);
                xmlWriter.WriteStartElement(Octave3DConfigXMLInfo.ObjectSelectionPaint_ShapePixelHeightNode);
                xmlWriter.WriteString(objectSelectionSettings.PaintModeSettings.SelectionShapeHeightInPixels.ToString());
                xmlWriter.WriteEndElement();

                xmlWriter.WriteNewLine(2);
                xmlWriter.WriteStartElement(Octave3DConfigXMLInfo.ObjectSelectionPaint_SizeAdjustmentSpeedScrollWheelNode);
                xmlWriter.WriteString(objectSelectionSettings.PaintModeSettings.ScrollWheelShapeSizeAdjustmentSpeed.ToString());
                xmlWriter.WriteEndElement();

                xmlWriter.WriteNewLine(1);
                xmlWriter.WriteEndElement();
            }
        }
        public void HandleMouseButtonDownEvent(Event e)
        {
            if (e.InvolvesLeftMouseButton())
            {
                e.DisableInSceneView();

                _isVisibleForStandardMode = true;
                if (ObjectSelectionSettings.Get().SelectionMode == ObjectSelectionMode.Standard)
                {
                    GetShape().SetEnclosingRectMinMaxPoints(e.InvMousePos(SceneViewCamera.Camera));
                }
            }
        }
        public bool IsVisible()
        {
            if (!MouseCursor.Instance.IsInsideSceneView())
            {
                return(false);
            }
            if (ObjectSelectionSettings.Get().SelectionMode == ObjectSelectionMode.Standard)
            {
                return(_isVisibleForStandardMode);
            }

            return(true);
        }
        private void OnBeforeRender()
        {
            ObjectSelectionSettings selectionSettings = ObjectSelectionSettings.Get();

            if (selectionSettings.SelectionMode == ObjectSelectionMode.Paint)
            {
                ObjectSelectionPaintModeSettings paintModeSettings = selectionSettings.PaintModeSettings;
                SetWidthHeight(paintModeSettings.SelectionShapeWidthInPixels, paintModeSettings.SelectionShapeHeightInPixels);

                GetShape().EnclosingRectCenter = Event.current.InvMousePos(SceneViewCamera.Camera);
                SceneView.RepaintAll();
            }
        }
Example #5
0
        public override void Render()
        {
            RenderSelectionTransformGizmoSystemControls();

            _objectSelectionActionsToolbar.Render();
            _objectSelectionActionsView.Render();

            ObjectSelection.Get().MirrorView.Render();
            Octave3DWorldBuilder.ActiveInstance.PlacementObjectGroupDatabase.View.Render();
            ObjectSelectionSettings.Get().View.Render();
            ObjectSelectionPrefabCreationSettings.Get().View.Render();
            ObjectSelection.Get().ObjectOnSurfaceProjectSettings.RenderView();
            _lookAndFeelSettingsView.Render();
        }
 public void HandleMouseDragEvent(Event e)
 {
     if (e.InvolvesLeftMouseButton())
     {
         if (ObjectSelectionSettings.Get().SelectionMode == ObjectSelectionMode.Standard)
         {
             AdjustStandardShapeSizeForMouseDragEvent(e);
         }
         if (!MouseCursor.Instance.IsInsideSceneView())
         {
             _isVisibleForStandardMode = false;
         }
     }
 }
        private ObjectInteraction2DShape GetShape()
        {
            ObjectSelectionSettings selectionSettings = ObjectSelectionSettings.Get();

            if (selectionSettings.SelectionShapeType == ObjectSelectionShapeType.Ellipse)
            {
                return(_ellipseShape);
            }
            else if (selectionSettings.SelectionShapeType == ObjectSelectionShapeType.Rectangle)
            {
                return(_rectangleShape);
            }

            return(null);
        }
Example #8
0
        private void DeselectObjectsWithSelectionShape(List <GameObject> gameObjectsOverlappedBySelectionShape)
        {
            if (gameObjectsOverlappedBySelectionShape.Count != 0)
            {
                ObjectSelection           objectSelection      = ObjectSelection.Get();
                ObjectSelectionUpdateMode _selectionUpdateMode = ObjectSelectionSettings.Get().SelectionUpdateMode;

                if (_selectionUpdateMode == ObjectSelectionUpdateMode.EntireHierarchy)
                {
                    UndoEx.RecordForToolAction(objectSelection);
                    objectSelection.RemoveEntireGameObjectHierarchyFromSelection(gameObjectsOverlappedBySelectionShape);
                }
                else
                {
                    UndoEx.RecordForToolAction(objectSelection);
                    objectSelection.RemoveGameObjectCollectionFromSelection(gameObjectsOverlappedBySelectionShape);
                }
                objectSelection.ObjectSelectionGizmos.OnObjectSelectionUpdatedUsingSelectionShape();
            }
        }
Example #9
0
        private static void SaveObjectSelectionSettings(XmlTextWriter xmlWriter, Octave3DConfigSaveLoadSettings saveSettings)
        {
            if (saveSettings.ObjectSelectionSettings)
            {
                ObjectSelectionSettings objectSelectionSettings = ObjectSelectionSettings.Get();

                xmlWriter.WriteNewLine(1);
                xmlWriter.WriteStartElement(Octave3DConfigXMLInfo.ObjectSelectionSettingsNode);

                xmlWriter.WriteNewLine(2);
                xmlWriter.WriteStartElement(Octave3DConfigXMLInfo.ObjectSelectionAttachToObjectGroupNode);
                xmlWriter.WriteString(objectSelectionSettings.ObjectGroupSettings.AttachToObjectGroup.ToString());
                xmlWriter.WriteEndElement();

                if (objectSelectionSettings.ObjectGroupSettings.DestinationGroup != null &&
                    objectSelectionSettings.ObjectGroupSettings.DestinationGroup.GroupObject != null)
                {
                    xmlWriter.WriteNewLine(2);
                    xmlWriter.WriteStartElement(Octave3DConfigXMLInfo.ObjectSelectionDestinationObjectGroupNode);
                    xmlWriter.WriteString(objectSelectionSettings.ObjectGroupSettings.DestinationGroup.GroupObject.name);
                    xmlWriter.WriteEndElement();
                }

                xmlWriter.WriteNewLine(2);
                xmlWriter.WriteStartElement(Octave3DConfigXMLInfo.ObjectSelectionXRotationStepNode);
                xmlWriter.WriteString(objectSelectionSettings.XRotationStep.ToString());
                xmlWriter.WriteEndElement();

                xmlWriter.WriteNewLine(2);
                xmlWriter.WriteStartElement(Octave3DConfigXMLInfo.ObjectSelectionYRotationStepNode);
                xmlWriter.WriteString(objectSelectionSettings.YRotationStep.ToString());
                xmlWriter.WriteEndElement();

                xmlWriter.WriteNewLine(2);
                xmlWriter.WriteStartElement(Octave3DConfigXMLInfo.ObjectSelectionZRotationStepNode);
                xmlWriter.WriteString(objectSelectionSettings.ZRotationStep.ToString());
                xmlWriter.WriteEndElement();

                xmlWriter.WriteNewLine(2);
                xmlWriter.WriteStartElement(Octave3DConfigXMLInfo.ObjectSelectionRotateAroundCenterNode);
                xmlWriter.WriteString(objectSelectionSettings.RotateAroundSelectionCenter.ToString());
                xmlWriter.WriteEndElement();

                xmlWriter.WriteNewLine(2);
                xmlWriter.WriteStartElement(Octave3DConfigXMLInfo.ObjectSelectionObject2ObjectSnapSettingsNode);

                xmlWriter.WriteNewLine(3);
                xmlWriter.WriteStartElement(Octave3DConfigXMLInfo.ObjectSelectionObj2ObjSnapEpsNode);
                xmlWriter.WriteString(objectSelectionSettings.Object2ObjectSnapSettings.SnapEps.ToString());
                xmlWriter.WriteEndElement();

                xmlWriter.WriteNewLine(3);
                xmlWriter.WriteStartElement(Octave3DConfigXMLInfo.ObjectSelectionObj2ObjSnapCanHoverObjectsNode);
                xmlWriter.WriteString(objectSelectionSettings.Object2ObjectSnapSettings.CanHoverObjects.ToString());
                xmlWriter.WriteEndElement();

                xmlWriter.WriteNewLine(2);
                xmlWriter.WriteEndElement();

                xmlWriter.WriteNewLine(2);
                xmlWriter.WriteStartElement(Octave3DConfigXMLInfo.ObjectSelectionAllowPartialOverlapNode);
                xmlWriter.WriteString(objectSelectionSettings.AllowPartialOverlap.ToString());
                xmlWriter.WriteEndElement();

                xmlWriter.WriteNewLine(2);
                xmlWriter.WriteStartElement(Octave3DConfigXMLInfo.ObjectSelectionShapeTypeNode);
                xmlWriter.WriteString(objectSelectionSettings.SelectionShapeType.ToString());
                xmlWriter.WriteEndElement();

                xmlWriter.WriteNewLine(2);
                xmlWriter.WriteStartElement(Octave3DConfigXMLInfo.ObjectSelectionUpdateModeNode);
                xmlWriter.WriteString(objectSelectionSettings.SelectionUpdateMode.ToString());
                xmlWriter.WriteEndElement();

                xmlWriter.WriteNewLine(2);
                xmlWriter.WriteStartElement(Octave3DConfigXMLInfo.ObjectSelectionModeNode);
                xmlWriter.WriteString(objectSelectionSettings.SelectionMode.ToString());
                xmlWriter.WriteEndElement();

                xmlWriter.WriteNewLine(2);
                xmlWriter.WriteStartElement(Octave3DConfigXMLInfo.ObjectSelectionPaint_ShapePixelWidthNode);
                xmlWriter.WriteString(objectSelectionSettings.PaintModeSettings.SelectionShapeWidthInPixels.ToString());
                xmlWriter.WriteEndElement();

                xmlWriter.WriteNewLine(2);
                xmlWriter.WriteStartElement(Octave3DConfigXMLInfo.ObjectSelectionPaint_ShapePixelHeightNode);
                xmlWriter.WriteString(objectSelectionSettings.PaintModeSettings.SelectionShapeHeightInPixels.ToString());
                xmlWriter.WriteEndElement();

                xmlWriter.WriteNewLine(2);
                xmlWriter.WriteStartElement(Octave3DConfigXMLInfo.ObjectSelectionPaint_SizeAdjustmentSpeedScrollWheelNode);
                xmlWriter.WriteString(objectSelectionSettings.PaintModeSettings.ScrollWheelShapeSizeAdjustmentSpeed.ToString());
                xmlWriter.WriteEndElement();

                xmlWriter.WriteNewLine(1);
                xmlWriter.WriteEndElement();
            }
        }