Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge master changes #2

Merged
merged 47 commits into from
Jun 11, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
8303da8
Introducing new primitive type: Capsule! And code cleanup.
Henry00IS May 12, 2018
a4f09f6
Merge branch 'master' of https://github.com/sabresaurus/SabreCSG into…
Henry00IS May 19, 2018
5383f88
Merge branch 'master' of https://github.com/sabresaurus/SabreCSG into…
Henry00IS May 20, 2018
4f6683f
Merge branch 'master' of https://github.com/sabresaurus/SabreCSG into…
Henry00IS May 21, 2018
3551282
Merge branch 'master' of https://github.com/sabresaurus/SabreCSG into…
Henry00IS May 23, 2018
5cb37fb
Merge branch 'master' of https://github.com/sabresaurus/SabreCSG into…
Henry00IS May 30, 2018
d19dd02
Merge remote-tracking branch 'refs/remotes/sabresaurus/master' into b…
nukeandbeans Jun 1, 2018
8784d2d
Add ReflectionProbeUsage settings
nukeandbeans Jun 1, 2018
4fca65e
The checkbox will reset the reflection probes to Blend Probes at ever…
Henry00IS Jun 1, 2018
c56fea9
Disabled CSG Models will no longer enable their MeshGroup during play…
Henry00IS Jun 1, 2018
b9abbca
Merge pull request #132 from Kerfuffles/feature-additions
Henry00IS Jun 1, 2018
c5026ed
Now only looks at the CSG Model enabled checkbox so it works like a t…
Henry00IS Jun 1, 2018
7313e33
Merge pull request #134 from Henry00IS/Fix131
Henry00IS Jun 1, 2018
6553c31
Merge branch 'master' of https://github.com/sabresaurus/SabreCSG into…
Henry00IS Jun 1, 2018
b564498
Add Hollow Box Brush
nukeandbeans Jun 2, 2018
b1bb6d3
Fix CS0252
nukeandbeans Jun 4, 2018
838c077
2D Shape Editor can now extrude segments.
Henry00IS Jun 4, 2018
1b36ce7
Merge pull request #136 from Henry00IS/2DSEExtrude
Henry00IS Jun 4, 2018
d97ef6c
use #if NET_4_6 to detect if the project is on the .net 4.x backend
nukeandbeans Jun 5, 2018
2780944
Now using (compoundBrushType is Type) check as discussed.
Henry00IS Jun 5, 2018
ef390ca
Merge pull request #135 from Kerfuffles/bugfix
Henry00IS Jun 5, 2018
f3dc644
Merge branch 'master' of https://github.com/sabresaurus/SabreCSG into…
Henry00IS Jun 5, 2018
d00358a
Created a new icon for the Capsule. Added BeautifulBrushName.
Henry00IS Jun 5, 2018
93349ee
Merge pull request #115 from Henry00IS/Capsule
Henry00IS Jun 5, 2018
beac0d7
MathHelper.cs PlaneEqualsLooserWithFlip is now even looser (less prec…
Henry00IS Jun 5, 2018
75e346d
Increased the floats slightly which took care of a lot of artifacts I…
Henry00IS Jun 5, 2018
4f551ad
Additional fine-tuning to deal with extremely complex subtractive bru…
Henry00IS Jun 5, 2018
ccf13b5
Faster and more accurate material searches for VMF and T3D. Fixed all…
Henry00IS Jun 5, 2018
8662431
Merge pull request #139 from Henry00IS/MaterialSearcher
Henry00IS Jun 5, 2018
8b375d2
Add BrushSize feature.
nukeandbeans Jun 6, 2018
04d7df2
Removed unused namespaces.
nukeandbeans Jun 6, 2018
2dae65f
Allow individual dimention size setting for XYZ axis
nukeandbeans Jun 6, 2018
f6a45a1
2DSE: Fixed inverted extrude direction on flipped projects.
Henry00IS Jun 6, 2018
49de97c
Merge pull request #143 from Henry00IS/2DSEExtrude
Henry00IS Jun 6, 2018
16c7338
Merge branch 'master' of https://github.com/sabresaurus/SabreCSG into…
Henry00IS Jun 6, 2018
cac1d92
Merge pull request #138 from Henry00IS/SubtractiveCorruptions
Henry00IS Jun 6, 2018
ae72fac
Code Cleanup + bugfix
nukeandbeans Jun 7, 2018
81b241e
Merge pull request #140 from Kerfuffles/feature-additions
Henry00IS Jun 7, 2018
cc96901
Updated SabreCSG version to 1.7.0.
Henry00IS Jun 7, 2018
62eb757
Fixed HollowBoxBrush compilation errors.
Henry00IS Jun 7, 2018
41b6136
Merge pull request #144 from Henry00IS/HollowBoxBrushErrors
Henry00IS Jun 7, 2018
94e3317
Updated SabreCSG version to 1.7.1.
Henry00IS Jun 7, 2018
be874bf
Optimize Geometry has been demoted and is now off by default.
Henry00IS Jun 7, 2018
a501744
Merge pull request #145 from Henry00IS/OptimizeDemoted
Henry00IS Jun 7, 2018
eae0fae
Fixed HollowBoxBrush inspector compilation errors.
Henry00IS Jun 7, 2018
72de49d
Merge pull request #146 from Henry00IS/HollowBoxBrushErrors
Henry00IS Jun 7, 2018
ab9f8db
Updated SabreCSG version to 1.7.2.
Henry00IS Jun 7, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added Gizmos/ButtonCapsule.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
77 changes: 77 additions & 0 deletions Gizmos/ButtonCapsule.png.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file added Gizmos/ShapeEditorSegmentExtrude.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
87 changes: 87 additions & 0 deletions Gizmos/ShapeEditorSegmentExtrude.png.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

47 changes: 47 additions & 0 deletions Scripts/Brushes/CompoundBrushes/Editor/HollowBoxBrushInspector.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEditor;
using UnityEngine;

namespace Sabresaurus.SabreCSG
{
[CanEditMultipleObjects]
[CustomEditor(typeof(HollowBoxBrush), true)]
public class HollowBoxBrushInspector : CompoundBrushInspector
{
SerializedProperty wallThicknessProp;

public override void DoInspectorGUI()
{
using (new NamedVerticalScope("Hollow Box"))
{
EditorGUI.BeginChangeCheck();
EditorGUILayout.PropertyField(wallThicknessProp);

if (EditorGUI.EndChangeCheck())
{
ApplyAndInvalidate();
}

EditorGUILayout.Space();
}

base.DoInspectorGUI();
}

protected override void OnEnable()
{
base.OnEnable();

// Setup the SerializedProperties.
wallThicknessProp = serializedObject.FindProperty("wallThickness");
}

private void ApplyAndInvalidate()
{
serializedObject.ApplyModifiedProperties();
System.Array.ForEach(BrushTargets, item => item.Invalidate(true));
}
}
}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

34 changes: 34 additions & 0 deletions Scripts/Brushes/CompoundBrushes/Editor/ShapeEditorWindow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -510,6 +510,11 @@ private void OnGUI()
OnSegmentInsert();
Event.current.Use();
}
if (Event.current.keyCode == KeyCode.E)
{
OnSegmentExtrude();
Event.current.Use();
}
if (Event.current.keyCode == KeyCode.Delete)
{
OnDelete();
Expand Down Expand Up @@ -787,6 +792,10 @@ private void OnGUI()
{
OnSegmentInsert();
}
if (GUILayout.Button(new GUIContent(SabreCSGResources.ShapeEditorSegmentExtrudeTexture, "Extrude Segment(s) (E)"), createBrushStyle))
{
OnSegmentExtrude();
}
if (GUILayout.Button(new GUIContent(SabreCSGResources.ShapeEditorDeleteTexture, "Delete Segment(s) or Shape(s) (DEL)"), createBrushStyle))
{
OnDelete();
Expand Down Expand Up @@ -1140,6 +1149,31 @@ private void OnSegmentInsert()
}
}

/// <summary>
/// Called when the extrude segment button is pressed. Will extrude all selected segments.
/// </summary>
private void OnSegmentExtrude()
{
foreach (Segment segment in selectedSegments.ToArray()) // use .ToArray() to iterate a clone.
{
bool inverted = project.flipHorizontally ^ project.flipVertically;
Segment next = GetNextSegment(segment);
// calculate extrude direction.
Vector2Int pos1 = (inverted ? segment.position - next.position : next.position - segment.position);
Vector2 dir = new Vector2(pos1.y, -pos1.x).normalized * 2.0f;
// insert new segments at an extruded distance.
Shape parent = GetShapeOfSegment(segment);
Segment select;
parent.segments.Insert(parent.segments.IndexOf(next), select = new Segment(segment.position.x + Mathf.RoundToInt(dir.x), segment.position.y + Mathf.RoundToInt(dir.y)));
parent.segments.Insert(parent.segments.IndexOf(next), new Segment(next.position.x + Mathf.RoundToInt(dir.x), next.position.y + Mathf.RoundToInt(dir.y)));
// recalculate the pivot position of the shape.
parent.CalculatePivotPosition();
// update the selection so we have the extruded segment selected, this improves the workflow experience.
selectedObjects.Remove(segment);
selectedObjects.Add(select);
}
}

/// <summary>
/// Called when the delete button is pressed. Will delete all selected segments and shapes.
/// </summary>
Expand Down
Loading