public void RemoveAndDestroyPattern(ObjectPlacementPathHeightPattern pathHeightPattern)
        {
            if (ContainsPattern(pathHeightPattern))
            {
                _pathHeightPatterns.RemoveEntity(pathHeightPattern);
                ObjectPlacementPathHeightPatternWasRemovedFromDatabaseMessage.SendToInterestedListeners(pathHeightPattern);

                UndoEx.DestroyObjectImmediate(pathHeightPattern);
            }
        }
Beispiel #2
0
        private void RenderActiveGroupSelectionPopup()
        {
            int newInt = EditorGUILayoutEx.Popup(GetContentForActiveGroupSelectionPopup(), _database.IndexOfActiveGroup, _database.GetAllObjectGroupNames());

            if (newInt != _database.IndexOfActiveGroup)
            {
                UndoEx.RecordForToolAction(_database);
                _database.SetActiveObjectGroup(_database.GetObjectGroupByIndex(newInt));
            }
        }
        public void RemoveAndDestroyPrefabTag(PrefabTag prefabTag)
        {
            if (ContainsPrefabTag(prefabTag))
            {
                _prefabTags.RemoveEntity(prefabTag);
                PrefabTagWasRemovedFromDatabaseMessage.SendToInterestedListeners(prefabTag);

                UndoEx.DestroyObjectImmediate(prefabTag);
            }
        }
Beispiel #4
0
        private void RenderRadiusField()
        {
            float newFloat = EditorGUILayout.FloatField(GetContentForRadiusField(), _brush.Radius);

            if (newFloat != _brush.Radius)
            {
                UndoEx.RecordForToolAction(_brush);
                _brush.Radius = newFloat;
            }
        }
Beispiel #5
0
        private void RenderPreserveGroupChildrenToggle()
        {
            bool newBool = EditorGUILayout.ToggleLeft(GetContentForPreserveGroupChildrenToggle(), _database.PreserveGroupChildren);

            if (newBool != _database.PreserveGroupChildren)
            {
                UndoEx.RecordForToolAction(_database);
                _database.PreserveGroupChildren = newBool;
            }
        }
Beispiel #6
0
        private void RenderCircleShapeRadiusField()
        {
            int newInt = EditorGUILayout.IntField(GetContentForCircleShapeRadiusField(), _settings.CircleShapeRadius);

            if (newInt != _settings.CircleShapeRadius)
            {
                UndoEx.RecordForToolAction(_settings);
                _settings.CircleShapeRadius = newInt;
            }
        }
        private void RenderSelectionModeSelectionPopup()
        {
            ObjectSelectionMode newSelectionMode = (ObjectSelectionMode)EditorGUILayout.EnumPopup(GetContentForSelectionModeSelectionPopup(), _settings.SelectionMode);

            if (newSelectionMode != _settings.SelectionMode)
            {
                UndoEx.RecordForToolAction(_settings);
                _settings.SelectionMode = newSelectionMode;
            }
        }
Beispiel #8
0
        private void RenderCreateNewCategoryNameChangeTextField()
        {
            string newString = EditorGUILayout.TextField(ViewData.NameForNewPrefabCategory);

            if (newString != ViewData.NameForNewPrefabCategory)
            {
                UndoEx.RecordForToolAction(ViewData);
                ViewData.NameForNewPrefabCategory = newString;
            }
        }
Beispiel #9
0
        private void RenderPrefabOffsetFromObjectSurfaceField()
        {
            float newFloat = EditorGUILayout.FloatField(ViewData.PrefabOffsetFromObjectSurface);

            if (newFloat != ViewData.PrefabOffsetFromObjectSurface)
            {
                UndoEx.RecordForToolAction(ViewData);
                ViewData.PrefabOffsetFromObjectSurface = newFloat;
            }
        }
Beispiel #10
0
        private void RenderDestinationCategoryForElementPrefabsSelectionPopup()
        {
            string newString = EditorGUILayoutEx.Popup(GetContentForDestinationCategoryForElementPrefabsSelectionPopup(), _brush.DestinationCategoryForElementPrefabs.Name, PrefabCategoryDatabase.Get().GetAllPrefabCategoryNames());

            if (newString != _brush.DestinationCategoryForElementPrefabs.Name)
            {
                UndoEx.RecordForToolAction(_brush);
                _brush.DestinationCategoryForElementPrefabs = PrefabCategoryDatabase.Get().GetPrefabCategoryByName(newString);
            }
        }
        private void RenderFilterByActiveTagsToggle()
        {
            bool newBool = EditorGUILayout.ToggleLeft(GetContentForFilterByActiveTagsToggle(), _prefabFilter.FilterByActiveTags.IsActive);

            if (newBool != _prefabFilter.FilterByActiveTags.IsActive)
            {
                UndoEx.RecordForToolAction(_prefabFilter);
                _prefabFilter.FilterByActiveTags.SetActive(newBool);
            }
        }
Beispiel #12
0
        private void RenderIgnoreObjectsOutsideOfPaintSurfaceToggle()
        {
            bool newBool = EditorGUILayout.ToggleLeft(GetContentForIgnoreObjectsOutsideOfPaintSurfaceToggle(), _brush.IgnoreObjectsOutsideOfPaintSurface);

            if (newBool != _brush.IgnoreObjectsOutsideOfPaintSurface)
            {
                UndoEx.RecordForToolAction(_brush);
                _brush.IgnoreObjectsOutsideOfPaintSurface = newBool;
            }
        }
Beispiel #13
0
        private void RenderDistanceBetweenObjectsField()
        {
            float newFloat = EditorGUILayout.FloatField(GetContentForDistanceBetweenObjectsField(), _brush.DistanceBetweenObjects);

            if (newFloat != _brush.DistanceBetweenObjects)
            {
                UndoEx.RecordForToolAction(_brush);
                _brush.DistanceBetweenObjects = newFloat;
            }
        }
Beispiel #14
0
        private void RenderMaxNumberOfObjectsField()
        {
            int newInt = EditorGUILayout.IntField(GetContentForMaxNumberOfObjectsField(), _brush.MaxNumberOfObjects);

            if (newInt != _brush.MaxNumberOfObjects)
            {
                UndoEx.RecordForToolAction(_brush);
                _brush.MaxNumberOfObjects = newInt;
            }
        }
        private void RenderSelectionAssignmentLayerSelectionPopup()
        {
            int newInt = EditorGUILayout.LayerField(GetContentForSelectionAssignmentLayerSelectionPopup(), ViewData.SelectionAssignmentLayer);

            if (newInt != ViewData.SelectionAssignmentLayer)
            {
                UndoEx.RecordForToolAction(ViewData);
                ViewData.SelectionAssignmentLayer = newInt;
            }
        }
        private void RenderAllowPartialOverlapToggle()
        {
            bool newBool = EditorGUILayout.ToggleLeft(GetContentForAllowPartialOverlapToggle(), _settings.AllowPartialOverlap);

            if (newBool != _settings.AllowPartialOverlap)
            {
                UndoEx.RecordForToolAction(_settings);
                _settings.AllowPartialOverlap = newBool;
            }
        }
Beispiel #17
0
        private void RenderNextPrefabButton(float buttonWidth)
        {
            if (GUILayout.Button(GetContentForNextPrefabButton(), GUILayout.Width(buttonWidth)))
            {
                PrefabCategory activePrefabCategory = PrefabCategoryDatabase.Get().ActivePrefabCategory;

                UndoEx.RecordForToolAction(activePrefabCategory);
                PrefabCategoryActions.ActivateNextPrefabInPrefabCategory(activePrefabCategory);
            }
        }
Beispiel #18
0
        private void RenderCreateNewGroupNameChangeTextField()
        {
            string newString = EditorGUILayout.TextField(ViewData.NameForNewGroup);

            if (newString != ViewData.NameForNewGroup)
            {
                UndoEx.RecordForToolAction(ViewData);
                ViewData.NameForNewGroup = newString;
            }
        }
Beispiel #19
0
        private void RenderNameChangeField()
        {
            string newString = EditorGUILayout.TextField(GetContentForNameChangeField(), _brush.Name);

            if (newString != _brush.Name)
            {
                UndoEx.RecordForToolAction(_brush);
                DecorPaintObjectPlacementBrushDatabase.Get().RenameBrush(_brush, newString);
            }
        }
        private void AdjustSelectionShapeSizeForMouseWheelScroll(Event e)
        {
            ObjectSelectionPaintModeSettings paintModeSettings = _settings.PaintModeSettings;
            int sizeAdjustAmount = (int)(-e.delta.y * paintModeSettings.ScrollWheelShapeSizeAdjustmentSpeed);

            UndoEx.RecordForToolAction(this);
            paintModeSettings.SelectionShapeWidthInPixels  += sizeAdjustAmount;
            paintModeSettings.SelectionShapeHeightInPixels += sizeAdjustAmount;

            SceneView.RepaintAll();
        }
Beispiel #21
0
        private void RenderPatternNameChangeTextField()
        {
            ObjectPlacementPathHeightPatternDatabase patternDatabase = ObjectPlacementPathHeightPatternDatabase.Get();
            string newString = EditorGUILayoutEx.DelayedTextField(GetContentForPatternNameChangeField(), _heightPattern.Name);

            if (newString != _heightPattern.Name)
            {
                UndoEx.RecordForToolAction(_heightPattern);
                patternDatabase.RenamePattern(_heightPattern, newString);
            }
        }
        private void RenderDroppedPrefabFoldersTagSelectionControls()
        {
            _tagSelectionForDroppedPrefabFolders.PrefabTagFilter = PrefabTagFilterForTagSelection;
            _tagSelectionForDroppedPrefabFolders.Render();

            if (_tagSelectionForDroppedPrefabFolders.HasSelectionChanged)
            {
                UndoEx.RecordForToolAction(_settings);
                _settings.TagNamesForDroppedFolders = _tagSelectionForDroppedPrefabFolders.ListOfSelectedTagNames;
            }
        }