public void Perform()
        {
            MouseCursorRayHit cursorRayHit = ObjectEraser.Get().GetMouseCursorRayHit();

            if (cursorRayHit.WasAnObjectHit)
            {
                List <GameObject> objectsToErase = cursorRayHit.GetAllObjectsSortedByHitDistance();
                objectsToErase = ObjectEraser.Get().FilterObjectsWhichCanBeErased(objectsToErase);
                if (objectsToErase.Count == 0)
                {
                    return;
                }

                objectsToErase = new List <GameObject> {
                    objectsToErase[0]
                };

                bool eraseEntireHierarchy = !AllShortcutCombos.Instance.EraseIndividualObjects.IsActive();
                if (eraseEntireHierarchy)
                {
                    ObjectErase.EraseObjectHierarchiesInObjectCollection(objectsToErase);
                }
                else
                {
                    ObjectErase.EraseGameObjectCollection(objectsToErase);
                }
            }
        }
Exemplo n.º 2
0
        public override void Initialize()
        {
            base.Initialize();

            _lookAndFeelSettingsView.IsVisible = false;

            EllipseShapeRenderSettingsView circle2DShapeRenderSettingsView = ObjectEraser.Get().Circle2DMassEraseShapeRenderSettings.View;

            circle2DShapeRenderSettingsView.ToggleVisibilityBeforeRender = true;
            circle2DShapeRenderSettingsView.IndentContent         = true;
            circle2DShapeRenderSettingsView.VisibilityToggleLabel = "2D Mass Erase Circle";

            XZOrientedEllipseShapeRenderSettingsView circle3DShapeRenderSettingsView = ObjectEraser.Get().Circle3DMassEraseShapeRenderSettings.View;

            circle3DShapeRenderSettingsView.ToggleVisibilityBeforeRender = true;
            circle3DShapeRenderSettingsView.IndentContent         = true;
            circle3DShapeRenderSettingsView.VisibilityToggleLabel = "3D Mass Erase Circle";

            ObjectEraser.Get().EraseMask.View.SurroundWithBox = true;

            ObjectLayerObjectMaskView objectLayerObjectMaskView = ObjectEraser.Get().EraseMask.ObjectLayerObjectMask.View;

            objectLayerObjectMaskView.IsVisible = false;
            objectLayerObjectMaskView.ToggleVisibilityBeforeRender = true;
            objectLayerObjectMaskView.VisibilityToggleIndent       = 1;
            objectLayerObjectMaskView.VisibilityToggleLabel        = "Object Layer Erase Mask";

            ObjectCollectionMaskView objectCollectionMaskView = ObjectEraser.Get().EraseMask.ObjectCollectionMask.View;

            objectCollectionMaskView.IsVisible = false;
            objectCollectionMaskView.ToggleVisibilityBeforeRender = true;
            objectCollectionMaskView.VisibilityToggleIndent       = 1;
            objectCollectionMaskView.VisibilityToggleLabel        = "Object Erase Mask";
        }
Exemplo n.º 3
0
        protected override void RenderContent()
        {
            ObjectEraser objectEraser = ObjectEraser.Get();

            objectEraser.Circle2DMassEraseShapeRenderSettings.View.Render();
            objectEraser.Circle3DMassEraseShapeRenderSettings.View.Render();
        }
        private void RenderAllowPartialOverlapToggle()
        {
            bool newBool = EditorGUILayout.ToggleLeft(GetContentForAllowPartialOverlapToggle(), _settings.AllowPartialOverlap);

            if (newBool != _settings.AllowPartialOverlap)
            {
                UndoEx.RecordForToolAction(ObjectEraser.Get());
                _settings.AllowPartialOverlap = newBool;
            }
        }
        private void RenderScrollWheelCircleRadiusAdjustmentSpeedField()
        {
            float newFloat = EditorGUILayout.FloatField(GetContentForScrollWheelCircleRadiusAdjustmentSpeedField(), _settings.ScrollWheelCircleRadiusAdjustmentSpeed);

            if (newFloat != _settings.ScrollWheelCircleRadiusAdjustmentSpeed)
            {
                UndoEx.RecordForToolAction(ObjectEraser.Get());
                _settings.ScrollWheelCircleRadiusAdjustmentSpeed = newFloat;
            }
        }
Exemplo n.º 6
0
        public override void Render()
        {
            ObjectEraserSettings.Get().View.Render();

            EditorGUILayout.Separator();
            ObjectEraser.Get().EraseMask.View.Render();

            EditorGUILayout.Separator();
            _lookAndFeelSettingsView.Render();
        }
Exemplo n.º 7
0
        protected override void HandleMouseButtonDownEvent(Event e)
        {
            if (!CanEventBeHandled(e))
            {
                return;
            }
            base.HandleMouseButtonDownEvent(e);

            ObjectEraser.Get().HandleMouseButtonDownEvent(e);
        }
Exemplo n.º 8
0
        protected override void HandleMouseScrollWheelEvent(Event e)
        {
            if (!CanEventBeHandled(e))
            {
                return;
            }
            base.HandleMouseScrollWheelEvent(e);

            ObjectEraser.Get().HandleMouseScrollWheelEvent(e);
        }
Exemplo n.º 9
0
        public void Perform()
        {
            List <GameObject> gameObjectsForMassEraseOperation = ObjectEraser.Get().GetGameObjectsForMassEraseOperation();

            bool eraseEntireHierarchy = !AllShortcutCombos.Instance.EraseIndividualObjects.IsActive();

            if (eraseEntireHierarchy)
            {
                ObjectErase.EraseObjectHierarchiesInObjectCollection(gameObjectsForMassEraseOperation);
            }
            else
            {
                ObjectErase.EraseGameObjectCollection(gameObjectsForMassEraseOperation);
            }
        }
Exemplo n.º 10
0
        private static void SaveObjectErasingLookAndFeel(XmlTextWriter xmlWriter, Octave3DConfigSaveLoadSettings saveSettings)
        {
            if (saveSettings.ObjectErasingLookAndFeel)
            {
                EllipseShapeRenderSettings           circle2DRenderSettings = ObjectEraser.Get().Circle2DMassEraseShapeRenderSettings;
                XZOrientedEllipseShapeRenderSettings circle3DRenderSettings = ObjectEraser.Get().Circle3DMassEraseShapeRenderSettings;

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

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

                xmlWriter.WriteNewLine(3);
                xmlWriter.WriteStartElement(Octave3DConfigXMLInfo.ObjectErasingShapeFillColorNode);
                xmlWriter.WriteColorString(circle2DRenderSettings.FillColor);
                xmlWriter.WriteEndElement();

                xmlWriter.WriteNewLine(3);
                xmlWriter.WriteStartElement(Octave3DConfigXMLInfo.ObjectErasingShapeBorderColorNode);
                xmlWriter.WriteColorString(circle2DRenderSettings.BorderLineColor);
                xmlWriter.WriteEndElement();

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

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

                xmlWriter.WriteNewLine(3);
                xmlWriter.WriteStartElement(Octave3DConfigXMLInfo.ObjectErasingShapeBorderColorNode);
                xmlWriter.WriteColorString(circle3DRenderSettings.BorderLineColor);
                xmlWriter.WriteEndElement();

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

                xmlWriter.WriteNewLine(1);
                xmlWriter.WriteEndElement();
            }
        }
Exemplo n.º 11
0
        protected override void HandleButtonClick(int buttonIndex)
        {
            switch (buttonIndex)
            {
            case 0:

                //UndoEx.RecordForToolAction(DecorPaintObjectPlacement.Get().DecorPaintMask.ObjectCollectionMask);
                DecorPaintObjectPlacement.Get().DecorPaintMask.ObjectCollectionMask.Mask(ObjectSelection.Get().GetAllSelectedGameObjects());
                break;

            case 1:

                //UndoEx.RecordForToolAction(DecorPaintObjectPlacement.Get().DecorPaintMask.ObjectCollectionMask);
                DecorPaintObjectPlacement.Get().DecorPaintMask.ObjectCollectionMask.Unmask(ObjectSelection.Get().GetAllSelectedGameObjects());
                break;

            case 2:

                //UndoEx.RecordForToolAction(ObjectSnapping.Get().ObjectSnapMask.ObjectCollectionMask);
                ObjectSnapping.Get().ObjectSnapMask.ObjectCollectionMask.Mask(ObjectSelection.Get().GetAllSelectedGameObjects());
                break;

            case 3:

                //UndoEx.RecordForToolAction(ObjectSnapping.Get().ObjectSnapMask.ObjectCollectionMask);
                ObjectSnapping.Get().ObjectSnapMask.ObjectCollectionMask.Unmask(ObjectSelection.Get().GetAllSelectedGameObjects());
                break;

            case 4:

                ObjectEraser.Get().EraseMask.ObjectCollectionMask.Mask(ObjectSelection.Get().GetAllSelectedGameObjects());
                break;

            case 5:

                ObjectEraser.Get().EraseMask.ObjectCollectionMask.Unmask(ObjectSelection.Get().GetAllSelectedGameObjects());
                break;
            }
        }
Exemplo n.º 12
0
 public static bool CanGameObjectBeErased(GameObject gameObject)
 {
     return(ObjectQueries.CanGameObjectBeInteractedWith(gameObject) && !ObjectEraser.Get().EraseMask.IsGameObjectMasked(gameObject));
 }
Exemplo n.º 13
0
 public static ObjectEraserSettings Get()
 {
     return(ObjectEraser.Get().Settings);
 }
 public override void RenderGizmos()
 {
     ObjectSnapping.Get().XZSnapGrid.RenderGizmos();
     ObjectEraser.Get().RenderGizmos();
 }