diff --git a/Changelog.txt b/Changelog.txt
deleted file mode 100644
index 0f5be94e..00000000
--- a/Changelog.txt
+++ /dev/null
@@ -1,249 +0,0 @@
-1.4.0:
-
-Added experimental support for procedural CSG usage, this can be activated in the SabreCSG tab in Unity Preferences
-Added the start of per face vertex color support
-Added draw brush tool
-Added option to set up a 4 split optimised for level design (Window -> CSG 4 Split)
-Improved results from Select All
-Fixed clipping not resetting brush pivot immediately
-Default brush is now created on top of the grid (at 0,1,0) rather than centered on 0,0,0 as this is more consistent with brush drawing
-Pressing D activates Draw mode, pressing C activates Clip mode
-Added default physics material to build settings
-Added new icon buttons for creating brushes instead of the old Create drop down
-Started on a new default material type that tints based on vertex color
-Started on new shaders for vertex color and tri-planar support
-Created new docs for the 1.4 procedural API at http://sabrecsg.com/docs/
-Started on a shortcut for swapping the active scene view to the closest axis-aligned iso view (Edit -> Iso Align Nearest Angle), this will have a nicer shortcut in a later beta
-NoCSG brushes are now displayed differently to add and subtract brushes to make it clearer that they behave differently. Both brush color and hierarchy icon are new.
-While copying material with the C key held, you can now click and drag it over multiple polygons rather than each polygon requiring a click
-New radial menu when you press the J key in the scene view for aligning the camera more quickly
-UI for CSG Model build settings has been rewritten, making it much clearer and easier to use
-Added option in Build Settings for setting the default visual material
-Three new presets for default visual material - lit texture, lit texture that tints by vertex color, unlit vertex color
-Changing the visual material on the CSG Model instantly updates the built meshes and doesn't require a rebuild
-Brushes from other CSG Models are now displayed while editing a CSG Model and are selectable. Selecting a brush from a different CSG Model will automatically switch the active CSG Model to the new selection's parent.
-Copy material and follow last face now support copying vertex colors
-Removed the margin from the Create Brush buttons so they look a little nicer
-When you change any of the build settings, the build engine is now aware that a full rebuild is necessary. If auto rebuild is on this build will occur immediately, otherwise it will occur when you next activate rebuild. Note that the build engine compares against the last rebuild, so changing a flag and changing it back before a rebuild occurs will not trigger an unnecessary full rebuild.
-The tag on the CSG Model object is now copied to built meshes in addition to the existing support for layer and static flags
-When duplicating objects inside a CSG Model, the order of the objects is now respected. This works around a Unity bug by transparently overriding the duplication command when CSG is being edited.
-Key mappings have been moved to a ScriptableObject, you can reconfigure key mappings from the Inspector now
-You can now change cylinder and sphere side counts in the same way as a prism
-Fixed an changing physics material doesn't require a rebuild, but one takes place. It actually instantly marks the built meshes correctly, so no rebuild is necessary
-Fixed an error from dragging a brush prefab into the scene, note that brushes must still be under a CSGModel to build
-Added new visualisation of excluded faces which can be turned on in Prefs
-Fixed an error that was displayed when deleting a prefab that included multiple intersecting brushes
-Brushes and CSG Models are now stripped out at build time rather than on first play. This makes final builds significantly more optimal and fixes serializer warnings. The CSGModelRuntime component previously required on CSG Models is now obsolete and will be automatically removed from existing CSG Models.
-Fixed some issues with missing polygons
-Fixed a rare case where a build would error
-Material meshes and collision meshes are now generated local to the CSG Model, making it easier to manipulate them at runtime
-As part of the new experimental run-time support, you can now build a CSG Model in a background thread via scripting
-Excluding and reincluding a face in the face tool now respects vertex colors
-Stopped polygon hovering when your mouse is over the face tool UI
-Fixed subtractions not using vertex colors
-Fixed issues with translating vertices resetting vertex normals for smoothed polygons
-Fixed selecting a brush prefab in the project producing a null reference exception
-Fixed dragging a brush prefab into the scene but not under a CSG Model producing an error
-Fixed flipped UVs when drawing brushes in certain situations
-Fixed regression in 1.4 Beta 1 with layer and static flags not being preserved in built objects
-Fixed static flags, layer and tag not being copied when transferring polygon material (which creates a temporary new mesh game object)
-Fixed an issue with lightmap UV unwrapping producing overlapping UVs that caused lightmap artefacts
-Fixed an issue with hidden geometry not being removed
-Fixed a performance slow down when deleting a brush in scenes that have huge numbers of brushes
-When reincluding a polygon, tangents are now generated in all cases where the last build had generate tangents enabled
-Fixed issues with auto rebuild and partial rebuilds not picking up changes to nested brushes if the parent is transformed
-Fixed some performance issues in the Face tool
-
-
-1.3.2:
-
-Lightmap UV unwrapping can now be configured on the CSG Model build settings
-Fixed issue with unloading a level with high brush counts taking longer
-Fixed building hanging in certain situations
-Fixed issue with extraneous polygons
-Fixed issue with missing polygons
-Rewritten subtraction code
-Fixed some inconsistencies in moving a CSG Model and rebuilding
-Fixed an issue where a Force Rebuild could ignore root transform changes
-
-
-1.3.1:
-
-Includes support for Unity 5.4 Retina Editor
-Fixes some issues relating to a serialiser conflict
-Fixed minor errors thrown if you delete a brush while currently translating or rotating the UVs on its face
-
-
-1.3.0:
-
-SabreCSG build engine has been rewritten from the ground up, it now tracks changes and only rebuilds brushes that have actually changed
-Added an option for Auto-Rebuild, when enabled this will continually check for changes to brushes and rebuild them while you work
-Meshes built when Generate Lightmap UVs is set will always have the lightmap static flag set
-Built meshes now also inherit layer from the CSG Model
-Built mesh objects now inherit the static flags of the CSG Model
-Can now press Shift-Enter to split a brush in clip tool (in addition to the existing Enter shortcut for clip)
-Clip tool now supports multi-select
-When you split brushes all parts are now selected rather than just the original brush
-Clip tool now traces the intersected geometry in black
-Added option to clip tool to insert an edge loop (shortcut is L)
-Added an option in resize tool for snapping a brush center to the absolute grid
-Added buttons to the resize tool for local flipping a brush at its pivot
-In axis-aligned isometric modes you can now resize a brush by using the edge of the brush, rather than just the resize handles, making it quicker to resize
-Edge tool has been merged into the vertex tool, this makes it a lot more intuitive as when you split an edge the vertex is selected, or when you join two vertcies the edge is selected without changing mode.
-Added option to vertex tool to split edges, inserting a vertex at their mid point. When used in conjunction with the vertex connect option this allows lots of new topologies, such as connecting a corner vertex to the centre of an edge. The previous "Split" button which would split two edges and then connect them has been renamed "Connect Mid-Points".
-Vertex auto-merge is now done when you release the mouse rather than at build time. This now makes it possible to undo and redo vertex auto-merges
-Added multi-select support to the vertex tool
-Vertex tool now selects newly welded vertices
-Connecting mid-points now supports dealing with multiple polygons across multiple brushes
-Vertex tool's connect now supports vertices across multiple faces
-Added an align to centre button on the face tools
-Ctrl+Alt left click to paste the last selected face's material on faces
-Added support for flatten and smoothing face normals
-Added support to the UV scale value to take both a uniform value (e.g. 5) and a U/V scale pair (e.g. 5,2), making it possible scale U and V independently
-Added support for Follow Last Face (Ctrl+Shift left click), taking the material and UVs from the last selected face and mapping them across the next selected face.
-Added Copy Material - while holding C and clicking a face will apply the last selected polygon's material
-Fixed some errors if you select a brush's faces and try to align them when some of them haven't actually been built. E.g. two cubes overlap, you select one which results in 6 source polygons being selected but in reality there's only 5 built polygons.
-Current texture scale values are now displayed for selected faces, you can also change the values by enterring a new scale and hitting enter
-Improved surface tool's handling of certain topologies
-Selection helpers have been moved to a foldable section on the same page
-Extrude brush now uses face orientation as a basis for the new brush's rotation, making it easier and more intuitive to resize
-Face mode UI has been greatly improved, now displays a preview of both the active material and the material's main texture
-Added UV offset to Face tool, works in a similar way to adjusting the UV scale.
-Added axis-aligned planar mapping to Face tool
-Completely new SabreCSG Grid implementation, fixes numerous issues in the old grid
-Green triangulation lines on brushes have been removed and brush selection has been moved to a new method
-Brushes that don't interact with CSG calculations have been renamed from Detail to NoCSG to be less confusing
-Changing brush boolean mode on the toolbar now supports multiselect
-Changing NoCSG, Collision and Visible flags on the toolbar now supports multiselect
-Added support for changing brush boolean mode with shortcuts whith the hierarchy window focussed
-Added shortcut for toggle brushes hidden (H)
-Removed free mode as it is now obsolete with the changes to support disabling CSG UI when a non-CSG object is selected and the introduction of a brushes hidden shortcut
-Added support for group and ungroup (shortcuts are G for group and Shift+G for ungroup)
-Reintroduced the green tint for selected faces, but at a fainter level
-Hierarchy ordering buttons on the brush inspector now support multiselect, also renamed as Set as First and Send Earlier, etc as it's easier to understand and less ambiguous
-Added option on the brush inspector to resize a brush to fit a specified certain local bounds in addition the the existing rescale option
-Fixed some issues with pressing , and . in face UI changing grid
-Can now hit enter to apply resize/rescale values on the brush inspector
-Fixed some issues with vertex sharing occuring when it shouldn't leading to weird problems in the surface tool
-Selection cycle now resets if the selection possibilities change, this should make selection a bit more intuitive
-When creating a new brush by clicking Create from the toolbar it now determines the position of the new brush by raycasting against the existing brushes, if no brushes are hit it will position the new brush at the scene view camera pivot point
-Added button the brush inspector to shell a brush (create a new brush from the source brush inset by the current positional snapping value)
-Added a requested preference to hide the grid in perspective scene views
-Fixed the grid displaying incorrect horizontal lines when in iso horizontal views (left, front etc). The grid also now colours origin lines by axis
-OBJs are now exported local to the CSG Model (this affects vertex positions and normals).
-Active tool no longer resets each time you recompile
-Fixed some issues with the grid drawing over brushes in certain situations
-Integrated a new Linear FPS Cam which can be enabled in preferences, this overrides the scene view FPS camera with one that moves at a constant speed
-Added shortcuts for changing the angular snapping (the same as the position snapping shortcuts, but with Shift held)
-Angular snapping increase/decrease behaviour has now changed. While the angle is above 15 degrees it changes in 15 degree increments, below 15 degrees it changes in 5 degree increments.
-Added IPostBuildListener, scripts implementing the interface that are attached or under a CSG Model will recieve a call to OnBuildFinished when the associated CSG Model build completes. This is useful if you want to use CSG Models for dynamic objects such as moving platforms.
-Shell brush will no longer create invalid brushes if you try to shell a brush that is too small
-Fixed some issues with resizing by bound edge with rotated bounds in Isometric Axis-Aligned scene views
-Fixed some of the textures being marked as compressed, all textures that ship with SabreCSG are now marked as true color for faster import times
-Fixed some issues with vertex connecting
-Fixed some issues with follow last face, it will now also handle following over edges that don't share a vertex
-Fixed an issue with it being difficult to resize a brush far from the origin if Unity was set to both local orientation and center pivot.
-Fixed an issue with undoing a multi-select resize not rescaling all the brushes correctly
-Fixed a null-reference if you undid a weld, then try to weld again without reselecting
-Fixed error when selecting a CSG Model that has been disabled after changing scene
-Fixed rotated brushes not displaying correct handles in axis-aligned views
-Fixed exporting OBJ from a disabled CSG Model in a reloaded scene
-New faces created from using the clip tool no longer use the default material, instead they use the material of one of the clipped source faces
-Fixed use of Generate Lightmap UVs causing errors in Face tool
-Changing a polygon's material in the face tool now preserves any UV2 or tangent information without a rebuild
-Fixed a couple of errors relating to changing material when multiple polygons with a particular material set up
-Fixed some issues with bounds resizing of complicated brushes with position snapping on causing vertices to drift or brushes becoming concave
-Fixed an issue with handles not drawing in deferred HDR setups
-
-
-1.2.0:
-
-Fixed new obsolesence code warnings in 5.3 relating to the multiscene changes
-OBJ Exporter will now reset any values that are non-rational (e.g. NaN), this fixes importing into some modelling tools. This is mainly relevant to overlapping geometry built with < 1.2.
-Auto UV now works off world position, rather than local position. When Auto UV'ing multiple coplanar faces they will now lay out more intuitively.
-Worked around a bug in 5.3 that was throwing a passive error error "srcAttach < m_CurrentFramebuffer.colorCount && "We should always resolve only current RT""
-Fixed a null reference when selecting the face of a built brush that has been deleted and hasn't been rebuilt yet
-Brush rescaling on the Inspector now supports scale triplets (e.g. 6,1,6)
-Fixed handles rendering incorrectly (too dark) when Linear color space is selected
-Interior geometry is now removed when building CSG
-Added support to select adjacent wall faces
-Added support to select adjacent ceiling or floor faces
-Added support to select all adjacent geometry
-Added support to select excluded faces
-When you click a brush in the hierarchy in face mode, the brush faces will now be selected
-Added extrude brush from face feature in face mode
-Added option to weld vertices to their center in vertex mode
-Added option to weld nearby vertices together within a distance tolerance
-Overlapping vertices will now automatically merge on build. This means you can now collapse geometry just by moving vertices together in vertex mode.
-Prisms and cylinders are now constructed with their cap faces containing a mid vertex
-Added support for marquee selection of brushes in resize mode
-Fixed an issue where brushes would report as being concave when they were rotated and resized
-Added undo to Face tools
-Added ability to select all faces with the current material (select a face with desired material first)
-Added vertex connect option for splitting a face between two vertices
-Added new edge mode, similar to the vertex mode, but selection is tied to edges
-Added edge splitting for splitting a face between the mid-points of two edges
-New rescale triplet now updates normals
-Resize tool now updates normals
-Fixed some bugs relating to UVs not setting dirty
-Fixed a bug with brushes not automatically retracking until rebuild when restored via undo/redo
-Fixed some issues relating to brush preview meshes being displayed when they should be hidden
-Fixed some issues relating to the new 1.2 multiple CSG model support
-Extrude brush from face will now switch to Resize mode with the new brush selected
-Backfire selection is now prevented in face mode, making it easier to select faces
-Fixed occasional lockup of resizing brushes
-Resize cursor should no longer persist when changing modes
-New 1.2 welding now updates normals and UVs
-Multiselected brush tools should now work correctly with brushes nested within brushes
-Fixed some issues with face aligning not working correctly with undo
-Fixed issues with wrong grid being displayed in certain situations
-Fixed some false negatives with concave detection to do with winding order.
-Fixed some false positives with concave detection to do with scaling of angular geometry (e.g. scale a prism by 900)
-Fixed some issues with missing polygons
-Translation in face mode now respects UV scale and will now stay exactly aligned with the cursor at non-default scales
-UV snapping in face mode now respects the positional snap distance including with faces at different UV scales
-Before clicking the "x 2" button or entering a scaler of 2 would make the face twice as tiled but that seemed counterintuitive. UV scaling values have been inverted. Now clicking x 2 will make the UVs twice as big (and half as tiled).
-Fixed brush resizing going off integer in some cases
-
-
-1.1.0:
-
-Added support for All, None and Invert face selection modes
-Added support for Auto Fit face
-Added support for aligning faces to edges
-Added support for excluding faces from final geometry
-Resize bounds is now for the entire selection and works with local/global modes
-Added support for multi-select translation by dragging the face of the resize box
-Added support for multi-select translation by box handle (and ctrl)
-Added support for multi-select rotation by ctrl-dragging resize handles
-Added support for local/global modes in resizing
-Added support for multi-select resizing
-Added support for multi-select ctrl-drag copying
-Added support for widgeted translation
-Added support for widgeted rotation (Global pivot only)
-SabreCSG interface will disappear if you select a non SabreCSG object in the hierarchy
-Removed the need for CurrentSettings game object, these will auto cleanup from existing scenes
-Add support for post build points, e.g. if using SuperCharacterController then you could have a hook which adds a BSPTree component to the collider
-OBJ Exporter now groups exported geometry by material
-Added support for prefab brushes
-SabreCSG folder location is no longer hard coded, you can move the SabreCSG folder inside subfolders in Assets/
-Fixed deleted brushes remaining in brush count until rebuild
-Fixed clip tool having issues with scaled brushes
-Fixed shortcut issues on Windows (Rebuild is now Ctrl-Shift-R on Windows and Cmd-Shift-R on OSX)
-Fixed compiler issue on Web Player platform
-Fixed some issues with shift selection picking the wrong objects
-Fixed some issues with disabling SabreCSG interface not persisting
-Fixed issues with Unity 5.3 display
-Fixed prefab support
-Fixed Create and Grid dropdowns now display in correct place
-Split parts from the clip tool now share the source position in the hierarchy (before one part was going to the end)
-
-
-1.0.1:
-
-Fix for a build issue
-
-
-1.0.0:
-
-Initial release
\ No newline at end of file
diff --git a/Example Materials.meta b/Example Materials.meta
index 2a09c257..c3d348bb 100644
--- a/Example Materials.meta
+++ b/Example Materials.meta
@@ -1,5 +1,10 @@
fileFormatVersion: 2
-guid: a988c9733123f4117a68493bf4725aa9
+guid: 06844674c66487c45bc7046e52ca067f
folderAsset: yes
+timeCreated: 1522131882
+licenseType: Free
DefaultImporter:
+ externalObjects: {}
userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Example Materials/Default_Map_PaleBlue.mat.meta b/Example Materials/Default_Map_PaleBlue.mat.meta
deleted file mode 100644
index 7d2bcf2b..00000000
--- a/Example Materials/Default_Map_PaleBlue.mat.meta
+++ /dev/null
@@ -1,8 +0,0 @@
-fileFormatVersion: 2
-guid: eb2201db09b154ec3bb3eb2f7e7aad93
-timeCreated: 1442060906
-licenseType: Free
-NativeFormatImporter:
- userData:
- assetBundleName:
- assetBundleVariant:
diff --git a/Example Materials/Default_Map_Purple.mat.meta b/Example Materials/Default_Map_Purple.mat.meta
deleted file mode 100644
index 21d5285f..00000000
--- a/Example Materials/Default_Map_Purple.mat.meta
+++ /dev/null
@@ -1,8 +0,0 @@
-fileFormatVersion: 2
-guid: 4826ee4895e4244569956aa2fd1b6a76
-timeCreated: 1442060945
-licenseType: Free
-NativeFormatImporter:
- userData:
- assetBundleName:
- assetBundleVariant:
diff --git a/Example Materials/Default_Map_Red.mat b/Example Materials/Default_Map_Red.mat
deleted file mode 100644
index 1bc11e1c..00000000
--- a/Example Materials/Default_Map_Red.mat
+++ /dev/null
@@ -1,138 +0,0 @@
-%YAML 1.1
-%TAG !u! tag:unity3d.com,2011:
---- !u!21 &2100000
-Material:
- serializedVersion: 6
- m_ObjectHideFlags: 0
- m_PrefabParentObject: {fileID: 0}
- m_PrefabInternal: {fileID: 0}
- m_Name: Default_Map_Red
- m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0}
- m_ShaderKeywords:
- m_LightmapFlags: 5
- m_CustomRenderQueue: -1
- stringTagMap: {}
- m_SavedProperties:
- serializedVersion: 2
- m_TexEnvs:
- data:
- first:
- name: _MainTex
- second:
- m_Texture: {fileID: 2800000, guid: 8afdb452080da4823806bfed94123b72, type: 3}
- m_Scale: {x: 1, y: 1}
- m_Offset: {x: 0, y: 0}
- data:
- first:
- name: _BumpMap
- second:
- m_Texture: {fileID: 0}
- m_Scale: {x: 1, y: 1}
- m_Offset: {x: 0, y: 0}
- data:
- first:
- name: _DetailNormalMap
- second:
- m_Texture: {fileID: 0}
- m_Scale: {x: 1, y: 1}
- m_Offset: {x: 0, y: 0}
- data:
- first:
- name: _ParallaxMap
- second:
- m_Texture: {fileID: 0}
- m_Scale: {x: 1, y: 1}
- m_Offset: {x: 0, y: 0}
- data:
- first:
- name: _OcclusionMap
- second:
- m_Texture: {fileID: 0}
- m_Scale: {x: 1, y: 1}
- m_Offset: {x: 0, y: 0}
- data:
- first:
- name: _EmissionMap
- second:
- m_Texture: {fileID: 0}
- m_Scale: {x: 1, y: 1}
- m_Offset: {x: 0, y: 0}
- data:
- first:
- name: _DetailMask
- second:
- m_Texture: {fileID: 0}
- m_Scale: {x: 1, y: 1}
- m_Offset: {x: 0, y: 0}
- data:
- first:
- name: _DetailAlbedoMap
- second:
- m_Texture: {fileID: 0}
- m_Scale: {x: 1, y: 1}
- m_Offset: {x: 0, y: 0}
- data:
- first:
- name: _MetallicGlossMap
- second:
- m_Texture: {fileID: 0}
- m_Scale: {x: 1, y: 1}
- m_Offset: {x: 0, y: 0}
- m_Floats:
- data:
- first:
- name: _SrcBlend
- second: 1
- data:
- first:
- name: _DstBlend
- second: 0
- data:
- first:
- name: _Cutoff
- second: .5
- data:
- first:
- name: _Parallax
- second: .0199999996
- data:
- first:
- name: _ZWrite
- second: 1
- data:
- first:
- name: _Glossiness
- second: .5
- data:
- first:
- name: _BumpScale
- second: 1
- data:
- first:
- name: _OcclusionStrength
- second: 1
- data:
- first:
- name: _DetailNormalMapScale
- second: 1
- data:
- first:
- name: _UVSec
- second: 0
- data:
- first:
- name: _Mode
- second: 0
- data:
- first:
- name: _Metallic
- second: 0
- m_Colors:
- data:
- first:
- name: _EmissionColor
- second: {r: 0, g: 0, b: 0, a: 1}
- data:
- first:
- name: _Color
- second: {r: 1, g: 1, b: 1, a: 1}
diff --git a/Example Materials/Default_Map_Red.mat.meta b/Example Materials/Default_Map_Red.mat.meta
deleted file mode 100644
index 827a0f62..00000000
--- a/Example Materials/Default_Map_Red.mat.meta
+++ /dev/null
@@ -1,8 +0,0 @@
-fileFormatVersion: 2
-guid: d49a882345078496495630533487df69
-timeCreated: 1442060941
-licenseType: Free
-NativeFormatImporter:
- userData:
- assetBundleName:
- assetBundleVariant:
diff --git a/Example Materials/Floor_Planks.mat b/Example Materials/Floor_Planks.mat
deleted file mode 100644
index 1b085460..00000000
--- a/Example Materials/Floor_Planks.mat
+++ /dev/null
@@ -1,149 +0,0 @@
-%YAML 1.1
-%TAG !u! tag:unity3d.com,2011:
---- !u!21 &2100000
-Material:
- serializedVersion: 6
- m_ObjectHideFlags: 0
- m_PrefabParentObject: {fileID: 0}
- m_PrefabInternal: {fileID: 0}
- m_Name: Floor_Planks
- m_Shader: {fileID: 45, guid: 0000000000000000f000000000000000, type: 0}
- m_ShaderKeywords: _METALLICGLOSSMAP _NORMALMAP _SPECGLOSSMAP
- m_LightmapFlags: 5
- m_CustomRenderQueue: -1
- stringTagMap: {}
- m_SavedProperties:
- serializedVersion: 2
- m_TexEnvs:
- data:
- first:
- name: _MainTex
- second:
- m_Texture: {fileID: 2800000, guid: 69ecf8e758fda4825964614013231477, type: 3}
- m_Scale: {x: 1, y: 1}
- m_Offset: {x: 0, y: 0}
- data:
- first:
- name: _BumpMap
- second:
- m_Texture: {fileID: 2800000, guid: a948c45b0ee794cafb8f44bf35a7cfc8, type: 3}
- m_Scale: {x: 1, y: 1}
- m_Offset: {x: 0, y: 0}
- data:
- first:
- name: _DetailNormalMap
- second:
- m_Texture: {fileID: 0}
- m_Scale: {x: 1, y: 1}
- m_Offset: {x: 0, y: 0}
- data:
- first:
- name: _ParallaxMap
- second:
- m_Texture: {fileID: 0}
- m_Scale: {x: 1, y: 1}
- m_Offset: {x: 0, y: 0}
- data:
- first:
- name: _OcclusionMap
- second:
- m_Texture: {fileID: 0}
- m_Scale: {x: 1, y: 1}
- m_Offset: {x: 0, y: 0}
- data:
- first:
- name: _EmissionMap
- second:
- m_Texture: {fileID: 0}
- m_Scale: {x: 1, y: 1}
- m_Offset: {x: 0, y: 0}
- data:
- first:
- name: _DetailMask
- second:
- m_Texture: {fileID: 0}
- m_Scale: {x: 1, y: 1}
- m_Offset: {x: 0, y: 0}
- data:
- first:
- name: _DetailAlbedoMap
- second:
- m_Texture: {fileID: 0}
- m_Scale: {x: 1, y: 1}
- m_Offset: {x: 0, y: 0}
- data:
- first:
- name: _MetallicGlossMap
- second:
- m_Texture: {fileID: 2800000, guid: cc4a2f15d1cef42f2a7de5b4c7c84a33, type: 3}
- m_Scale: {x: 1, y: 1}
- m_Offset: {x: 0, y: 0}
- data:
- first:
- name: _SpecGlossMap
- second:
- m_Texture: {fileID: 2800000, guid: cc4a2f15d1cef42f2a7de5b4c7c84a33, type: 3}
- m_Scale: {x: 1, y: 1}
- m_Offset: {x: 0, y: 0}
- m_Floats:
- data:
- first:
- name: _SrcBlend
- second: 1
- data:
- first:
- name: _DstBlend
- second: 0
- data:
- first:
- name: _Cutoff
- second: 0.5
- data:
- first:
- name: _Parallax
- second: 0.02
- data:
- first:
- name: _ZWrite
- second: 1
- data:
- first:
- name: _Glossiness
- second: 0.5
- data:
- first:
- name: _BumpScale
- second: 0.1
- data:
- first:
- name: _OcclusionStrength
- second: 1
- data:
- first:
- name: _DetailNormalMapScale
- second: 1
- data:
- first:
- name: _UVSec
- second: 0
- data:
- first:
- name: _Mode
- second: 0
- data:
- first:
- name: _Metallic
- second: 0
- m_Colors:
- data:
- first:
- name: _EmissionColor
- second: {r: 0, g: 0, b: 0, a: 1}
- data:
- first:
- name: _Color
- second: {r: 1, g: 1, b: 1, a: 1}
- data:
- first:
- name: _SpecColor
- second: {r: 0.2, g: 0.2, b: 0.2, a: 1}
diff --git a/Example Materials/Floor_Planks.mat.meta b/Example Materials/Floor_Planks.mat.meta
deleted file mode 100644
index 60264c8d..00000000
--- a/Example Materials/Floor_Planks.mat.meta
+++ /dev/null
@@ -1,8 +0,0 @@
-fileFormatVersion: 2
-guid: 2b8ef763b5374480391d28a289b72ebb
-timeCreated: 1442059803
-licenseType: Free
-NativeFormatImporter:
- userData:
- assetBundleName:
- assetBundleVariant:
diff --git a/Example Materials/Textures.meta b/Example Materials/Textures.meta
index cc43c154..10c14244 100644
--- a/Example Materials/Textures.meta
+++ b/Example Materials/Textures.meta
@@ -1,7 +1,7 @@
fileFormatVersion: 2
-guid: 9b0a3572b621a44dbbf3553a1b173c22
+guid: a195aa9d73972cb46a98d11c04e92462
folderAsset: yes
-timeCreated: 1442059645
+timeCreated: 1522286777
licenseType: Free
DefaultImporter:
userData:
diff --git a/Example Materials/Textures/Brick.png b/Example Materials/Textures/Brick.png
deleted file mode 100644
index de0fb461..00000000
Binary files a/Example Materials/Textures/Brick.png and /dev/null differ
diff --git a/Example Materials/Textures/Brick.png.meta b/Example Materials/Textures/Brick.png.meta
deleted file mode 100644
index 0a85a666..00000000
--- a/Example Materials/Textures/Brick.png.meta
+++ /dev/null
@@ -1,57 +0,0 @@
-fileFormatVersion: 2
-guid: ed76038382bde4d33afbf6cceda43ae7
-timeCreated: 1442059655
-licenseType: Free
-TextureImporter:
- fileIDToRecycleName: {}
- serializedVersion: 2
- mipmaps:
- mipMapMode: 0
- enableMipMap: 1
- linearTexture: 0
- correctGamma: 0
- fadeOut: 0
- borderMipMap: 0
- mipMapFadeDistanceStart: 1
- mipMapFadeDistanceEnd: 3
- bumpmap:
- convertToNormalMap: 0
- externalNormalMap: 0
- heightScale: 0.25
- normalMapFilter: 0
- isReadable: 0
- grayScaleToAlpha: 0
- generateCubemap: 0
- cubemapConvolution: 0
- cubemapConvolutionSteps: 8
- cubemapConvolutionExponent: 1.5
- seamlessCubemap: 0
- textureFormat: -3
- maxTextureSize: 2048
- textureSettings:
- filterMode: -1
- aniso: -1
- mipBias: -1
- wrapMode: -1
- nPOTScale: 1
- lightmap: 0
- rGBM: 0
- compressionQuality: 50
- allowsAlphaSplitting: 0
- spriteMode: 0
- spriteExtrude: 1
- spriteMeshType: 1
- alignment: 0
- spritePivot: {x: 0.5, y: 0.5}
- spriteBorder: {x: 0, y: 0, z: 0, w: 0}
- spritePixelsToUnits: 100
- alphaIsTransparency: 0
- textureType: -1
- buildTargetSettings: []
- spriteSheet:
- sprites: []
- outline: []
- spritePackingTag:
- userData:
- assetBundleName:
- assetBundleVariant:
diff --git a/Example Materials/Textures/Brick_Normal.png b/Example Materials/Textures/Brick_Normal.png
deleted file mode 100644
index 7d514a6e..00000000
Binary files a/Example Materials/Textures/Brick_Normal.png and /dev/null differ
diff --git a/Example Materials/Textures/Bricksmooth.png b/Example Materials/Textures/Bricksmooth.png
deleted file mode 100644
index baf5a034..00000000
Binary files a/Example Materials/Textures/Bricksmooth.png and /dev/null differ
diff --git a/Example Materials/Textures/Bricksmooth_N.png b/Example Materials/Textures/Bricksmooth_N.png
deleted file mode 100644
index a800bca0..00000000
Binary files a/Example Materials/Textures/Bricksmooth_N.png and /dev/null differ
diff --git a/Example Materials/Textures/Floor_Planks.png b/Example Materials/Textures/Floor_Planks.png
deleted file mode 100644
index dcfd5c95..00000000
Binary files a/Example Materials/Textures/Floor_Planks.png and /dev/null differ
diff --git a/Example Materials/Textures/Floor_Planks_N.png b/Example Materials/Textures/Floor_Planks_N.png
deleted file mode 100644
index ab646343..00000000
Binary files a/Example Materials/Textures/Floor_Planks_N.png and /dev/null differ
diff --git a/Example Materials/Textures/Floor_Planks_spec.png b/Example Materials/Textures/Floor_Planks_spec.png
deleted file mode 100644
index 792e2618..00000000
Binary files a/Example Materials/Textures/Floor_Planks_spec.png and /dev/null differ
diff --git a/Example Materials/Textures/default_map_GREY.png b/Example Materials/Textures/default_map_GREY.png
deleted file mode 100644
index 91fc983f..00000000
Binary files a/Example Materials/Textures/default_map_GREY.png and /dev/null differ
diff --git a/Example Materials/Textures/default_map_RED.png b/Example Materials/Textures/default_map_RED.png
deleted file mode 100644
index a342d921..00000000
Binary files a/Example Materials/Textures/default_map_RED.png and /dev/null differ
diff --git a/Example Materials/Textures/default_map_RED.png.meta b/Example Materials/Textures/default_map_RED.png.meta
deleted file mode 100644
index 3364de6d..00000000
--- a/Example Materials/Textures/default_map_RED.png.meta
+++ /dev/null
@@ -1,57 +0,0 @@
-fileFormatVersion: 2
-guid: 8afdb452080da4823806bfed94123b72
-timeCreated: 1442059650
-licenseType: Free
-TextureImporter:
- fileIDToRecycleName: {}
- serializedVersion: 2
- mipmaps:
- mipMapMode: 0
- enableMipMap: 1
- linearTexture: 0
- correctGamma: 0
- fadeOut: 0
- borderMipMap: 0
- mipMapFadeDistanceStart: 1
- mipMapFadeDistanceEnd: 3
- bumpmap:
- convertToNormalMap: 0
- externalNormalMap: 0
- heightScale: 0.25
- normalMapFilter: 0
- isReadable: 0
- grayScaleToAlpha: 0
- generateCubemap: 0
- cubemapConvolution: 0
- cubemapConvolutionSteps: 8
- cubemapConvolutionExponent: 1.5
- seamlessCubemap: 0
- textureFormat: -3
- maxTextureSize: 2048
- textureSettings:
- filterMode: -1
- aniso: -1
- mipBias: -1
- wrapMode: -1
- nPOTScale: 1
- lightmap: 0
- rGBM: 0
- compressionQuality: 50
- allowsAlphaSplitting: 0
- spriteMode: 0
- spriteExtrude: 1
- spriteMeshType: 1
- alignment: 0
- spritePivot: {x: 0.5, y: 0.5}
- spriteBorder: {x: 0, y: 0, z: 0, w: 0}
- spritePixelsToUnits: 100
- alphaIsTransparency: 0
- textureType: -1
- buildTargetSettings: []
- spriteSheet:
- sprites: []
- outline: []
- spritePackingTag:
- userData:
- assetBundleName:
- assetBundleVariant:
diff --git a/Example Materials/Textures/default_map_blue.png b/Example Materials/Textures/default_map_blue.png
deleted file mode 100644
index feb1f8c7..00000000
Binary files a/Example Materials/Textures/default_map_blue.png and /dev/null differ
diff --git a/Example Materials/Textures/default_map_blue.png.meta b/Example Materials/Textures/default_map_blue.png.meta
deleted file mode 100644
index 5badef52..00000000
--- a/Example Materials/Textures/default_map_blue.png.meta
+++ /dev/null
@@ -1,57 +0,0 @@
-fileFormatVersion: 2
-guid: 742d262fda73f49e582c4ee563ab00e6
-timeCreated: 1442059649
-licenseType: Free
-TextureImporter:
- fileIDToRecycleName: {}
- serializedVersion: 2
- mipmaps:
- mipMapMode: 0
- enableMipMap: 1
- linearTexture: 0
- correctGamma: 0
- fadeOut: 0
- borderMipMap: 0
- mipMapFadeDistanceStart: 1
- mipMapFadeDistanceEnd: 3
- bumpmap:
- convertToNormalMap: 0
- externalNormalMap: 0
- heightScale: 0.25
- normalMapFilter: 0
- isReadable: 0
- grayScaleToAlpha: 0
- generateCubemap: 0
- cubemapConvolution: 0
- cubemapConvolutionSteps: 8
- cubemapConvolutionExponent: 1.5
- seamlessCubemap: 0
- textureFormat: -3
- maxTextureSize: 2048
- textureSettings:
- filterMode: -1
- aniso: -1
- mipBias: -1
- wrapMode: -1
- nPOTScale: 1
- lightmap: 0
- rGBM: 0
- compressionQuality: 50
- allowsAlphaSplitting: 0
- spriteMode: 0
- spriteExtrude: 1
- spriteMeshType: 1
- alignment: 0
- spritePivot: {x: 0.5, y: 0.5}
- spriteBorder: {x: 0, y: 0, z: 0, w: 0}
- spritePixelsToUnits: 100
- alphaIsTransparency: 0
- textureType: -1
- buildTargetSettings: []
- spriteSheet:
- sprites: []
- outline: []
- spritePackingTag:
- userData:
- assetBundleName:
- assetBundleVariant:
diff --git a/Example Materials/Textures/default_map_paleBlue.png b/Example Materials/Textures/default_map_paleBlue.png
deleted file mode 100644
index d8d085cf..00000000
Binary files a/Example Materials/Textures/default_map_paleBlue.png and /dev/null differ
diff --git a/Example Materials/Textures/default_map_paleBlue.png.meta b/Example Materials/Textures/default_map_paleBlue.png.meta
deleted file mode 100644
index f859933d..00000000
--- a/Example Materials/Textures/default_map_paleBlue.png.meta
+++ /dev/null
@@ -1,57 +0,0 @@
-fileFormatVersion: 2
-guid: e74ed056bfe91423bbb20a4ba62dad0c
-timeCreated: 1442059654
-licenseType: Free
-TextureImporter:
- fileIDToRecycleName: {}
- serializedVersion: 2
- mipmaps:
- mipMapMode: 0
- enableMipMap: 1
- linearTexture: 0
- correctGamma: 0
- fadeOut: 0
- borderMipMap: 0
- mipMapFadeDistanceStart: 1
- mipMapFadeDistanceEnd: 3
- bumpmap:
- convertToNormalMap: 0
- externalNormalMap: 0
- heightScale: 0.25
- normalMapFilter: 0
- isReadable: 0
- grayScaleToAlpha: 0
- generateCubemap: 0
- cubemapConvolution: 0
- cubemapConvolutionSteps: 8
- cubemapConvolutionExponent: 1.5
- seamlessCubemap: 0
- textureFormat: -3
- maxTextureSize: 2048
- textureSettings:
- filterMode: -1
- aniso: -1
- mipBias: -1
- wrapMode: -1
- nPOTScale: 1
- lightmap: 0
- rGBM: 0
- compressionQuality: 50
- allowsAlphaSplitting: 0
- spriteMode: 0
- spriteExtrude: 1
- spriteMeshType: 1
- alignment: 0
- spritePivot: {x: 0.5, y: 0.5}
- spriteBorder: {x: 0, y: 0, z: 0, w: 0}
- spritePixelsToUnits: 100
- alphaIsTransparency: 0
- textureType: -1
- buildTargetSettings: []
- spriteSheet:
- sprites: []
- outline: []
- spritePackingTag:
- userData:
- assetBundleName:
- assetBundleVariant:
diff --git a/Example Materials/Textures/default_map_purple.png b/Example Materials/Textures/default_map_purple.png
deleted file mode 100644
index 81e75284..00000000
Binary files a/Example Materials/Textures/default_map_purple.png and /dev/null differ
diff --git a/Example Materials/Textures/default_map_purple.png.meta b/Example Materials/Textures/default_map_purple.png.meta
deleted file mode 100644
index 3a0b434d..00000000
--- a/Example Materials/Textures/default_map_purple.png.meta
+++ /dev/null
@@ -1,57 +0,0 @@
-fileFormatVersion: 2
-guid: c355a8222563c41d7a3c6cfa9c9cb23a
-timeCreated: 1442059653
-licenseType: Free
-TextureImporter:
- fileIDToRecycleName: {}
- serializedVersion: 2
- mipmaps:
- mipMapMode: 0
- enableMipMap: 1
- linearTexture: 0
- correctGamma: 0
- fadeOut: 0
- borderMipMap: 0
- mipMapFadeDistanceStart: 1
- mipMapFadeDistanceEnd: 3
- bumpmap:
- convertToNormalMap: 0
- externalNormalMap: 0
- heightScale: 0.25
- normalMapFilter: 0
- isReadable: 0
- grayScaleToAlpha: 0
- generateCubemap: 0
- cubemapConvolution: 0
- cubemapConvolutionSteps: 8
- cubemapConvolutionExponent: 1.5
- seamlessCubemap: 0
- textureFormat: -3
- maxTextureSize: 2048
- textureSettings:
- filterMode: -1
- aniso: -1
- mipBias: -1
- wrapMode: -1
- nPOTScale: 1
- lightmap: 0
- rGBM: 0
- compressionQuality: 50
- allowsAlphaSplitting: 0
- spriteMode: 0
- spriteExtrude: 1
- spriteMeshType: 1
- alignment: 0
- spritePivot: {x: 0.5, y: 0.5}
- spriteBorder: {x: 0, y: 0, z: 0, w: 0}
- spritePixelsToUnits: 100
- alphaIsTransparency: 0
- textureType: -1
- buildTargetSettings: []
- spriteSheet:
- sprites: []
- outline: []
- spritePackingTag:
- userData:
- assetBundleName:
- assetBundleVariant:
diff --git a/Example Materials/Textures/lambert1_Base_Color.png b/Example Materials/Textures/lambert1_Base_Color.png
deleted file mode 100644
index 93c4e128..00000000
Binary files a/Example Materials/Textures/lambert1_Base_Color.png and /dev/null differ
diff --git a/Example Materials/Textures/lambert1_Base_Color.png.meta b/Example Materials/Textures/lambert1_Base_Color.png.meta
deleted file mode 100644
index cef3ded5..00000000
--- a/Example Materials/Textures/lambert1_Base_Color.png.meta
+++ /dev/null
@@ -1,57 +0,0 @@
-fileFormatVersion: 2
-guid: 865e653fc118e42bdb478e709b97134b
-timeCreated: 1442059649
-licenseType: Free
-TextureImporter:
- fileIDToRecycleName: {}
- serializedVersion: 2
- mipmaps:
- mipMapMode: 0
- enableMipMap: 1
- linearTexture: 0
- correctGamma: 0
- fadeOut: 0
- borderMipMap: 0
- mipMapFadeDistanceStart: 1
- mipMapFadeDistanceEnd: 3
- bumpmap:
- convertToNormalMap: 0
- externalNormalMap: 0
- heightScale: 0.25
- normalMapFilter: 0
- isReadable: 0
- grayScaleToAlpha: 0
- generateCubemap: 0
- cubemapConvolution: 0
- cubemapConvolutionSteps: 8
- cubemapConvolutionExponent: 1.5
- seamlessCubemap: 0
- textureFormat: -3
- maxTextureSize: 2048
- textureSettings:
- filterMode: -1
- aniso: -1
- mipBias: -1
- wrapMode: -1
- nPOTScale: 1
- lightmap: 0
- rGBM: 0
- compressionQuality: 50
- allowsAlphaSplitting: 0
- spriteMode: 0
- spriteExtrude: 1
- spriteMeshType: 1
- alignment: 0
- spritePivot: {x: 0.5, y: 0.5}
- spriteBorder: {x: 0, y: 0, z: 0, w: 0}
- spritePixelsToUnits: 100
- alphaIsTransparency: 0
- textureType: -1
- buildTargetSettings: []
- spriteSheet:
- sprites: []
- outline: []
- spritePackingTag:
- userData:
- assetBundleName:
- assetBundleVariant:
diff --git a/Example Materials/Textures/lambert1_Base_Normal.png b/Example Materials/Textures/lambert1_Base_Normal.png
deleted file mode 100644
index e27114c9..00000000
Binary files a/Example Materials/Textures/lambert1_Base_Normal.png and /dev/null differ
diff --git a/Example Materials/Textures/lambert1_Base_Spec.png b/Example Materials/Textures/lambert1_Base_Spec.png
deleted file mode 100644
index 89ce24eb..00000000
Binary files a/Example Materials/Textures/lambert1_Base_Spec.png and /dev/null differ
diff --git a/Example Materials/Textures/lambert1_Base_Spec.png.meta b/Example Materials/Textures/lambert1_Base_Spec.png.meta
deleted file mode 100644
index d66da6c6..00000000
--- a/Example Materials/Textures/lambert1_Base_Spec.png.meta
+++ /dev/null
@@ -1,57 +0,0 @@
-fileFormatVersion: 2
-guid: 02a47c8c0e09744f58f40b6ef9f83956
-timeCreated: 1442059646
-licenseType: Free
-TextureImporter:
- fileIDToRecycleName: {}
- serializedVersion: 2
- mipmaps:
- mipMapMode: 0
- enableMipMap: 1
- linearTexture: 0
- correctGamma: 0
- fadeOut: 0
- borderMipMap: 0
- mipMapFadeDistanceStart: 1
- mipMapFadeDistanceEnd: 3
- bumpmap:
- convertToNormalMap: 0
- externalNormalMap: 0
- heightScale: 0.25
- normalMapFilter: 0
- isReadable: 0
- grayScaleToAlpha: 0
- generateCubemap: 0
- cubemapConvolution: 0
- cubemapConvolutionSteps: 8
- cubemapConvolutionExponent: 1.5
- seamlessCubemap: 0
- textureFormat: -3
- maxTextureSize: 2048
- textureSettings:
- filterMode: -1
- aniso: -1
- mipBias: -1
- wrapMode: -1
- nPOTScale: 1
- lightmap: 0
- rGBM: 0
- compressionQuality: 50
- allowsAlphaSplitting: 0
- spriteMode: 0
- spriteExtrude: 1
- spriteMeshType: 1
- alignment: 0
- spritePivot: {x: 0.5, y: 0.5}
- spriteBorder: {x: 0, y: 0, z: 0, w: 0}
- spritePixelsToUnits: 100
- alphaIsTransparency: 0
- textureType: -1
- buildTargetSettings: []
- spriteSheet:
- sprites: []
- outline: []
- spritePackingTag:
- userData:
- assetBundleName:
- assetBundleVariant:
diff --git a/Example Materials/Textures/scsg_bricks_0_d.tga b/Example Materials/Textures/scsg_bricks_0_d.tga
new file mode 100644
index 00000000..dbad9c8a
Binary files /dev/null and b/Example Materials/Textures/scsg_bricks_0_d.tga differ
diff --git a/Example Materials/Textures/default_map_GREY.png.meta b/Example Materials/Textures/scsg_bricks_0_d.tga.meta
similarity index 93%
rename from Example Materials/Textures/default_map_GREY.png.meta
rename to Example Materials/Textures/scsg_bricks_0_d.tga.meta
index 7abcf243..fdb25e29 100644
--- a/Example Materials/Textures/default_map_GREY.png.meta
+++ b/Example Materials/Textures/scsg_bricks_0_d.tga.meta
@@ -1,6 +1,6 @@
fileFormatVersion: 2
-guid: 459f141e45d4345f1b14462a560d9520
-timeCreated: 1450706013
+guid: 2a7fb32a0866ac04894b42589662a4b8
+timeCreated: 1522286800
licenseType: Free
TextureImporter:
fileIDToRecycleName: {}
@@ -26,7 +26,7 @@ TextureImporter:
cubemapConvolutionSteps: 7
cubemapConvolutionExponent: 1.5
seamlessCubemap: 0
- textureFormat: -3
+ textureFormat: -1
maxTextureSize: 2048
textureSettings:
filterMode: -1
diff --git a/Example Materials/Textures/scsg_bricks_0_d2.tga b/Example Materials/Textures/scsg_bricks_0_d2.tga
new file mode 100644
index 00000000..839878b8
Binary files /dev/null and b/Example Materials/Textures/scsg_bricks_0_d2.tga differ
diff --git a/Example Materials/Textures/Floor_Planks.png.meta b/Example Materials/Textures/scsg_bricks_0_d2.tga.meta
similarity index 90%
rename from Example Materials/Textures/Floor_Planks.png.meta
rename to Example Materials/Textures/scsg_bricks_0_d2.tga.meta
index 106af308..d1f1c7e5 100644
--- a/Example Materials/Textures/Floor_Planks.png.meta
+++ b/Example Materials/Textures/scsg_bricks_0_d2.tga.meta
@@ -1,6 +1,6 @@
fileFormatVersion: 2
-guid: 69ecf8e758fda4825964614013231477
-timeCreated: 1442059648
+guid: 55f9a5d4d58ec754e80dc2210c213ff5
+timeCreated: 1522286800
licenseType: Free
TextureImporter:
fileIDToRecycleName: {}
@@ -23,10 +23,10 @@ TextureImporter:
grayScaleToAlpha: 0
generateCubemap: 0
cubemapConvolution: 0
- cubemapConvolutionSteps: 8
+ cubemapConvolutionSteps: 7
cubemapConvolutionExponent: 1.5
seamlessCubemap: 0
- textureFormat: -3
+ textureFormat: -1
maxTextureSize: 2048
textureSettings:
filterMode: -1
diff --git a/Example Materials/Textures/scsg_bricks_0_m.tga b/Example Materials/Textures/scsg_bricks_0_m.tga
new file mode 100644
index 00000000..039c3ccb
Binary files /dev/null and b/Example Materials/Textures/scsg_bricks_0_m.tga differ
diff --git a/Example Materials/Textures/Bricksmooth.png.meta b/Example Materials/Textures/scsg_bricks_0_m.tga.meta
similarity index 90%
rename from Example Materials/Textures/Bricksmooth.png.meta
rename to Example Materials/Textures/scsg_bricks_0_m.tga.meta
index 97ee4f82..007595ba 100644
--- a/Example Materials/Textures/Bricksmooth.png.meta
+++ b/Example Materials/Textures/scsg_bricks_0_m.tga.meta
@@ -1,6 +1,6 @@
fileFormatVersion: 2
-guid: a07fb9adf062b4cd6bbef7ba4462450c
-timeCreated: 1442059651
+guid: 3353858f61a67cd4c9d99784f76e8e66
+timeCreated: 1522286800
licenseType: Free
TextureImporter:
fileIDToRecycleName: {}
@@ -23,10 +23,10 @@ TextureImporter:
grayScaleToAlpha: 0
generateCubemap: 0
cubemapConvolution: 0
- cubemapConvolutionSteps: 8
+ cubemapConvolutionSteps: 7
cubemapConvolutionExponent: 1.5
seamlessCubemap: 0
- textureFormat: -3
+ textureFormat: -1
maxTextureSize: 2048
textureSettings:
filterMode: -1
diff --git a/Example Materials/Textures/scsg_bricks_0_n.tga b/Example Materials/Textures/scsg_bricks_0_n.tga
new file mode 100644
index 00000000..2464f99e
Binary files /dev/null and b/Example Materials/Textures/scsg_bricks_0_n.tga differ
diff --git a/Example Materials/Textures/Floor_Planks_N.png.meta b/Example Materials/Textures/scsg_bricks_0_n.tga.meta
similarity index 90%
rename from Example Materials/Textures/Floor_Planks_N.png.meta
rename to Example Materials/Textures/scsg_bricks_0_n.tga.meta
index 633cfd04..e50efbf3 100644
--- a/Example Materials/Textures/Floor_Planks_N.png.meta
+++ b/Example Materials/Textures/scsg_bricks_0_n.tga.meta
@@ -1,6 +1,6 @@
fileFormatVersion: 2
-guid: a948c45b0ee794cafb8f44bf35a7cfc8
-timeCreated: 1442059652
+guid: 90bb2075cc819e2479d0286ac978cc6e
+timeCreated: 1522286835
licenseType: Free
TextureImporter:
fileIDToRecycleName: {}
@@ -23,10 +23,10 @@ TextureImporter:
grayScaleToAlpha: 0
generateCubemap: 0
cubemapConvolution: 0
- cubemapConvolutionSteps: 8
+ cubemapConvolutionSteps: 7
cubemapConvolutionExponent: 1.5
seamlessCubemap: 0
- textureFormat: -3
+ textureFormat: -1
maxTextureSize: 2048
textureSettings:
filterMode: -1
diff --git a/Example Materials/Textures/scsg_bricks_0_n2.tga b/Example Materials/Textures/scsg_bricks_0_n2.tga
new file mode 100644
index 00000000..e6b807a6
Binary files /dev/null and b/Example Materials/Textures/scsg_bricks_0_n2.tga differ
diff --git a/Example Materials/Textures/Brick_Normal.png.meta b/Example Materials/Textures/scsg_bricks_0_n2.tga.meta
similarity index 90%
rename from Example Materials/Textures/Brick_Normal.png.meta
rename to Example Materials/Textures/scsg_bricks_0_n2.tga.meta
index 399b3a23..4bac71d4 100644
--- a/Example Materials/Textures/Brick_Normal.png.meta
+++ b/Example Materials/Textures/scsg_bricks_0_n2.tga.meta
@@ -1,6 +1,6 @@
fileFormatVersion: 2
-guid: 49b9559fc6589480f98c273103741078
-timeCreated: 1442059647
+guid: 69a672569f3684c46aedfaadba2bdca2
+timeCreated: 1522286841
licenseType: Free
TextureImporter:
fileIDToRecycleName: {}
@@ -23,10 +23,10 @@ TextureImporter:
grayScaleToAlpha: 0
generateCubemap: 0
cubemapConvolution: 0
- cubemapConvolutionSteps: 8
+ cubemapConvolutionSteps: 7
cubemapConvolutionExponent: 1.5
seamlessCubemap: 0
- textureFormat: -3
+ textureFormat: -1
maxTextureSize: 2048
textureSettings:
filterMode: -1
diff --git a/Example Materials/Textures/scsg_bricks_0_o.tga b/Example Materials/Textures/scsg_bricks_0_o.tga
new file mode 100644
index 00000000..c79f9a19
Binary files /dev/null and b/Example Materials/Textures/scsg_bricks_0_o.tga differ
diff --git a/Example Materials/Textures/Floor_Planks_spec.png.meta b/Example Materials/Textures/scsg_bricks_0_o.tga.meta
similarity index 90%
rename from Example Materials/Textures/Floor_Planks_spec.png.meta
rename to Example Materials/Textures/scsg_bricks_0_o.tga.meta
index 9e4eaa46..7e4fe003 100644
--- a/Example Materials/Textures/Floor_Planks_spec.png.meta
+++ b/Example Materials/Textures/scsg_bricks_0_o.tga.meta
@@ -1,6 +1,6 @@
fileFormatVersion: 2
-guid: cc4a2f15d1cef42f2a7de5b4c7c84a33
-timeCreated: 1442059654
+guid: 015d3ae8bb7fdc24586590079f00191e
+timeCreated: 1522286799
licenseType: Free
TextureImporter:
fileIDToRecycleName: {}
@@ -23,10 +23,10 @@ TextureImporter:
grayScaleToAlpha: 0
generateCubemap: 0
cubemapConvolution: 0
- cubemapConvolutionSteps: 8
+ cubemapConvolutionSteps: 7
cubemapConvolutionExponent: 1.5
seamlessCubemap: 0
- textureFormat: -3
+ textureFormat: -1
maxTextureSize: 2048
textureSettings:
filterMode: -1
diff --git a/Example Materials/Textures/scsg_bricks_1_d.tga b/Example Materials/Textures/scsg_bricks_1_d.tga
new file mode 100644
index 00000000..2e06fd3e
Binary files /dev/null and b/Example Materials/Textures/scsg_bricks_1_d.tga differ
diff --git a/Example Materials/Textures/scsg_bricks_1_d.tga.meta b/Example Materials/Textures/scsg_bricks_1_d.tga.meta
new file mode 100644
index 00000000..cf2ab903
--- /dev/null
+++ b/Example Materials/Textures/scsg_bricks_1_d.tga.meta
@@ -0,0 +1,57 @@
+fileFormatVersion: 2
+guid: b81a4798a14591a448b6c21a1eb340b4
+timeCreated: 1522286804
+licenseType: Free
+TextureImporter:
+ fileIDToRecycleName: {}
+ serializedVersion: 2
+ mipmaps:
+ mipMapMode: 0
+ enableMipMap: 1
+ linearTexture: 0
+ correctGamma: 0
+ fadeOut: 0
+ borderMipMap: 0
+ mipMapFadeDistanceStart: 1
+ mipMapFadeDistanceEnd: 3
+ bumpmap:
+ convertToNormalMap: 0
+ externalNormalMap: 0
+ heightScale: 0.25
+ normalMapFilter: 0
+ isReadable: 0
+ grayScaleToAlpha: 0
+ generateCubemap: 0
+ cubemapConvolution: 0
+ cubemapConvolutionSteps: 7
+ cubemapConvolutionExponent: 1.5
+ seamlessCubemap: 0
+ textureFormat: -1
+ maxTextureSize: 2048
+ textureSettings:
+ filterMode: -1
+ aniso: -1
+ mipBias: -1
+ wrapMode: -1
+ nPOTScale: 1
+ lightmap: 0
+ rGBM: 0
+ compressionQuality: 50
+ allowsAlphaSplitting: 0
+ spriteMode: 0
+ spriteExtrude: 1
+ spriteMeshType: 1
+ alignment: 0
+ spritePivot: {x: 0.5, y: 0.5}
+ spriteBorder: {x: 0, y: 0, z: 0, w: 0}
+ spritePixelsToUnits: 100
+ alphaIsTransparency: 0
+ textureType: -1
+ buildTargetSettings: []
+ spriteSheet:
+ sprites: []
+ outline: []
+ spritePackingTag:
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Example Materials/Textures/scsg_bricks_1_m.tga b/Example Materials/Textures/scsg_bricks_1_m.tga
new file mode 100644
index 00000000..4c57951e
Binary files /dev/null and b/Example Materials/Textures/scsg_bricks_1_m.tga differ
diff --git a/Example Materials/Textures/scsg_bricks_1_m.tga.meta b/Example Materials/Textures/scsg_bricks_1_m.tga.meta
new file mode 100644
index 00000000..c0faa3ff
--- /dev/null
+++ b/Example Materials/Textures/scsg_bricks_1_m.tga.meta
@@ -0,0 +1,57 @@
+fileFormatVersion: 2
+guid: 80a6fb8fc412b8e4584281c08b695f30
+timeCreated: 1522286802
+licenseType: Free
+TextureImporter:
+ fileIDToRecycleName: {}
+ serializedVersion: 2
+ mipmaps:
+ mipMapMode: 0
+ enableMipMap: 1
+ linearTexture: 0
+ correctGamma: 0
+ fadeOut: 0
+ borderMipMap: 0
+ mipMapFadeDistanceStart: 1
+ mipMapFadeDistanceEnd: 3
+ bumpmap:
+ convertToNormalMap: 0
+ externalNormalMap: 0
+ heightScale: 0.25
+ normalMapFilter: 0
+ isReadable: 0
+ grayScaleToAlpha: 0
+ generateCubemap: 0
+ cubemapConvolution: 0
+ cubemapConvolutionSteps: 7
+ cubemapConvolutionExponent: 1.5
+ seamlessCubemap: 0
+ textureFormat: -1
+ maxTextureSize: 2048
+ textureSettings:
+ filterMode: -1
+ aniso: -1
+ mipBias: -1
+ wrapMode: -1
+ nPOTScale: 1
+ lightmap: 0
+ rGBM: 0
+ compressionQuality: 50
+ allowsAlphaSplitting: 0
+ spriteMode: 0
+ spriteExtrude: 1
+ spriteMeshType: 1
+ alignment: 0
+ spritePivot: {x: 0.5, y: 0.5}
+ spriteBorder: {x: 0, y: 0, z: 0, w: 0}
+ spritePixelsToUnits: 100
+ alphaIsTransparency: 0
+ textureType: -1
+ buildTargetSettings: []
+ spriteSheet:
+ sprites: []
+ outline: []
+ spritePackingTag:
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Example Materials/Textures/scsg_bricks_1_n.tga b/Example Materials/Textures/scsg_bricks_1_n.tga
new file mode 100644
index 00000000..9ad34a3f
Binary files /dev/null and b/Example Materials/Textures/scsg_bricks_1_n.tga differ
diff --git a/Example Materials/Textures/lambert1_Base_Normal.png.meta b/Example Materials/Textures/scsg_bricks_1_n.tga.meta
similarity index 90%
rename from Example Materials/Textures/lambert1_Base_Normal.png.meta
rename to Example Materials/Textures/scsg_bricks_1_n.tga.meta
index 48167c1f..c4427d52 100644
--- a/Example Materials/Textures/lambert1_Base_Normal.png.meta
+++ b/Example Materials/Textures/scsg_bricks_1_n.tga.meta
@@ -1,6 +1,6 @@
fileFormatVersion: 2
-guid: b55d4524f543a4b63902a71e67a16a8b
-timeCreated: 1442059653
+guid: 0032764f85b91f64e83dd49c3a74a7e7
+timeCreated: 1522286876
licenseType: Free
TextureImporter:
fileIDToRecycleName: {}
@@ -23,10 +23,10 @@ TextureImporter:
grayScaleToAlpha: 0
generateCubemap: 0
cubemapConvolution: 0
- cubemapConvolutionSteps: 8
+ cubemapConvolutionSteps: 7
cubemapConvolutionExponent: 1.5
seamlessCubemap: 0
- textureFormat: -3
+ textureFormat: -1
maxTextureSize: 2048
textureSettings:
filterMode: -1
diff --git a/Example Materials/Textures/scsg_bricks_1_o.tga b/Example Materials/Textures/scsg_bricks_1_o.tga
new file mode 100644
index 00000000..dfc8d131
Binary files /dev/null and b/Example Materials/Textures/scsg_bricks_1_o.tga differ
diff --git a/Example Materials/Textures/scsg_bricks_1_o.tga.meta b/Example Materials/Textures/scsg_bricks_1_o.tga.meta
new file mode 100644
index 00000000..d342e05f
--- /dev/null
+++ b/Example Materials/Textures/scsg_bricks_1_o.tga.meta
@@ -0,0 +1,57 @@
+fileFormatVersion: 2
+guid: fce541d616219a543b85f2136008491a
+timeCreated: 1522286804
+licenseType: Free
+TextureImporter:
+ fileIDToRecycleName: {}
+ serializedVersion: 2
+ mipmaps:
+ mipMapMode: 0
+ enableMipMap: 1
+ linearTexture: 0
+ correctGamma: 0
+ fadeOut: 0
+ borderMipMap: 0
+ mipMapFadeDistanceStart: 1
+ mipMapFadeDistanceEnd: 3
+ bumpmap:
+ convertToNormalMap: 0
+ externalNormalMap: 0
+ heightScale: 0.25
+ normalMapFilter: 0
+ isReadable: 0
+ grayScaleToAlpha: 0
+ generateCubemap: 0
+ cubemapConvolution: 0
+ cubemapConvolutionSteps: 7
+ cubemapConvolutionExponent: 1.5
+ seamlessCubemap: 0
+ textureFormat: -1
+ maxTextureSize: 2048
+ textureSettings:
+ filterMode: -1
+ aniso: -1
+ mipBias: -1
+ wrapMode: -1
+ nPOTScale: 1
+ lightmap: 0
+ rGBM: 0
+ compressionQuality: 50
+ allowsAlphaSplitting: 0
+ spriteMode: 0
+ spriteExtrude: 1
+ spriteMeshType: 1
+ alignment: 0
+ spritePivot: {x: 0.5, y: 0.5}
+ spriteBorder: {x: 0, y: 0, z: 0, w: 0}
+ spritePixelsToUnits: 100
+ alphaIsTransparency: 0
+ textureType: -1
+ buildTargetSettings: []
+ spriteSheet:
+ sprites: []
+ outline: []
+ spritePackingTag:
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Example Materials/Textures/scsg_default_map_blue.tga b/Example Materials/Textures/scsg_default_map_blue.tga
new file mode 100644
index 00000000..7a1361d9
Binary files /dev/null and b/Example Materials/Textures/scsg_default_map_blue.tga differ
diff --git a/Example Materials/Textures/scsg_default_map_blue.tga.meta b/Example Materials/Textures/scsg_default_map_blue.tga.meta
new file mode 100644
index 00000000..03429b14
--- /dev/null
+++ b/Example Materials/Textures/scsg_default_map_blue.tga.meta
@@ -0,0 +1,57 @@
+fileFormatVersion: 2
+guid: a76ef12d19981244fa01a5976ed56df9
+timeCreated: 1522286803
+licenseType: Free
+TextureImporter:
+ fileIDToRecycleName: {}
+ serializedVersion: 2
+ mipmaps:
+ mipMapMode: 0
+ enableMipMap: 1
+ linearTexture: 0
+ correctGamma: 0
+ fadeOut: 0
+ borderMipMap: 0
+ mipMapFadeDistanceStart: 1
+ mipMapFadeDistanceEnd: 3
+ bumpmap:
+ convertToNormalMap: 0
+ externalNormalMap: 0
+ heightScale: 0.25
+ normalMapFilter: 0
+ isReadable: 0
+ grayScaleToAlpha: 0
+ generateCubemap: 0
+ cubemapConvolution: 0
+ cubemapConvolutionSteps: 7
+ cubemapConvolutionExponent: 1.5
+ seamlessCubemap: 0
+ textureFormat: -1
+ maxTextureSize: 2048
+ textureSettings:
+ filterMode: -1
+ aniso: -1
+ mipBias: -1
+ wrapMode: -1
+ nPOTScale: 1
+ lightmap: 0
+ rGBM: 0
+ compressionQuality: 50
+ allowsAlphaSplitting: 0
+ spriteMode: 0
+ spriteExtrude: 1
+ spriteMeshType: 1
+ alignment: 0
+ spritePivot: {x: 0.5, y: 0.5}
+ spriteBorder: {x: 0, y: 0, z: 0, w: 0}
+ spritePixelsToUnits: 100
+ alphaIsTransparency: 0
+ textureType: -1
+ buildTargetSettings: []
+ spriteSheet:
+ sprites: []
+ outline: []
+ spritePackingTag:
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Example Materials/Textures/scsg_default_map_cyan.tga b/Example Materials/Textures/scsg_default_map_cyan.tga
new file mode 100644
index 00000000..dd7fd367
Binary files /dev/null and b/Example Materials/Textures/scsg_default_map_cyan.tga differ
diff --git a/Example Materials/Textures/scsg_default_map_cyan.tga.meta b/Example Materials/Textures/scsg_default_map_cyan.tga.meta
new file mode 100644
index 00000000..5795710d
--- /dev/null
+++ b/Example Materials/Textures/scsg_default_map_cyan.tga.meta
@@ -0,0 +1,57 @@
+fileFormatVersion: 2
+guid: a322c74676422ab4d8c3c604778cd532
+timeCreated: 1522286802
+licenseType: Free
+TextureImporter:
+ fileIDToRecycleName: {}
+ serializedVersion: 2
+ mipmaps:
+ mipMapMode: 0
+ enableMipMap: 1
+ linearTexture: 0
+ correctGamma: 0
+ fadeOut: 0
+ borderMipMap: 0
+ mipMapFadeDistanceStart: 1
+ mipMapFadeDistanceEnd: 3
+ bumpmap:
+ convertToNormalMap: 0
+ externalNormalMap: 0
+ heightScale: 0.25
+ normalMapFilter: 0
+ isReadable: 0
+ grayScaleToAlpha: 0
+ generateCubemap: 0
+ cubemapConvolution: 0
+ cubemapConvolutionSteps: 7
+ cubemapConvolutionExponent: 1.5
+ seamlessCubemap: 0
+ textureFormat: -1
+ maxTextureSize: 2048
+ textureSettings:
+ filterMode: -1
+ aniso: -1
+ mipBias: -1
+ wrapMode: -1
+ nPOTScale: 1
+ lightmap: 0
+ rGBM: 0
+ compressionQuality: 50
+ allowsAlphaSplitting: 0
+ spriteMode: 0
+ spriteExtrude: 1
+ spriteMeshType: 1
+ alignment: 0
+ spritePivot: {x: 0.5, y: 0.5}
+ spriteBorder: {x: 0, y: 0, z: 0, w: 0}
+ spritePixelsToUnits: 100
+ alphaIsTransparency: 0
+ textureType: -1
+ buildTargetSettings: []
+ spriteSheet:
+ sprites: []
+ outline: []
+ spritePackingTag:
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Example Materials/Textures/scsg_default_map_grey.tga b/Example Materials/Textures/scsg_default_map_grey.tga
new file mode 100644
index 00000000..d764e434
Binary files /dev/null and b/Example Materials/Textures/scsg_default_map_grey.tga differ
diff --git a/Example Materials/Textures/scsg_default_map_grey.tga.meta b/Example Materials/Textures/scsg_default_map_grey.tga.meta
new file mode 100644
index 00000000..b6bf2c5a
--- /dev/null
+++ b/Example Materials/Textures/scsg_default_map_grey.tga.meta
@@ -0,0 +1,57 @@
+fileFormatVersion: 2
+guid: f7731c2f2a066b1409997521e9be5d92
+timeCreated: 1522286804
+licenseType: Free
+TextureImporter:
+ fileIDToRecycleName: {}
+ serializedVersion: 2
+ mipmaps:
+ mipMapMode: 0
+ enableMipMap: 1
+ linearTexture: 0
+ correctGamma: 0
+ fadeOut: 0
+ borderMipMap: 0
+ mipMapFadeDistanceStart: 1
+ mipMapFadeDistanceEnd: 3
+ bumpmap:
+ convertToNormalMap: 0
+ externalNormalMap: 0
+ heightScale: 0.25
+ normalMapFilter: 0
+ isReadable: 0
+ grayScaleToAlpha: 0
+ generateCubemap: 0
+ cubemapConvolution: 0
+ cubemapConvolutionSteps: 7
+ cubemapConvolutionExponent: 1.5
+ seamlessCubemap: 0
+ textureFormat: -1
+ maxTextureSize: 2048
+ textureSettings:
+ filterMode: -1
+ aniso: -1
+ mipBias: -1
+ wrapMode: -1
+ nPOTScale: 1
+ lightmap: 0
+ rGBM: 0
+ compressionQuality: 50
+ allowsAlphaSplitting: 0
+ spriteMode: 0
+ spriteExtrude: 1
+ spriteMeshType: 1
+ alignment: 0
+ spritePivot: {x: 0.5, y: 0.5}
+ spriteBorder: {x: 0, y: 0, z: 0, w: 0}
+ spritePixelsToUnits: 100
+ alphaIsTransparency: 0
+ textureType: -1
+ buildTargetSettings: []
+ spriteSheet:
+ sprites: []
+ outline: []
+ spritePackingTag:
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Example Materials/Textures/scsg_default_map_purple.tga b/Example Materials/Textures/scsg_default_map_purple.tga
new file mode 100644
index 00000000..d3a10a23
Binary files /dev/null and b/Example Materials/Textures/scsg_default_map_purple.tga differ
diff --git a/Example Materials/Textures/scsg_default_map_purple.tga.meta b/Example Materials/Textures/scsg_default_map_purple.tga.meta
new file mode 100644
index 00000000..6fbc0b7a
--- /dev/null
+++ b/Example Materials/Textures/scsg_default_map_purple.tga.meta
@@ -0,0 +1,57 @@
+fileFormatVersion: 2
+guid: 94427715ad753ef41881b7d6a9f79b66
+timeCreated: 1522286802
+licenseType: Free
+TextureImporter:
+ fileIDToRecycleName: {}
+ serializedVersion: 2
+ mipmaps:
+ mipMapMode: 0
+ enableMipMap: 1
+ linearTexture: 0
+ correctGamma: 0
+ fadeOut: 0
+ borderMipMap: 0
+ mipMapFadeDistanceStart: 1
+ mipMapFadeDistanceEnd: 3
+ bumpmap:
+ convertToNormalMap: 0
+ externalNormalMap: 0
+ heightScale: 0.25
+ normalMapFilter: 0
+ isReadable: 0
+ grayScaleToAlpha: 0
+ generateCubemap: 0
+ cubemapConvolution: 0
+ cubemapConvolutionSteps: 7
+ cubemapConvolutionExponent: 1.5
+ seamlessCubemap: 0
+ textureFormat: -1
+ maxTextureSize: 2048
+ textureSettings:
+ filterMode: -1
+ aniso: -1
+ mipBias: -1
+ wrapMode: -1
+ nPOTScale: 1
+ lightmap: 0
+ rGBM: 0
+ compressionQuality: 50
+ allowsAlphaSplitting: 0
+ spriteMode: 0
+ spriteExtrude: 1
+ spriteMeshType: 1
+ alignment: 0
+ spritePivot: {x: 0.5, y: 0.5}
+ spriteBorder: {x: 0, y: 0, z: 0, w: 0}
+ spritePixelsToUnits: 100
+ alphaIsTransparency: 0
+ textureType: -1
+ buildTargetSettings: []
+ spriteSheet:
+ sprites: []
+ outline: []
+ spritePackingTag:
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Example Materials/Textures/scsg_default_map_red.tga b/Example Materials/Textures/scsg_default_map_red.tga
new file mode 100644
index 00000000..edfb3392
Binary files /dev/null and b/Example Materials/Textures/scsg_default_map_red.tga differ
diff --git a/Example Materials/Textures/scsg_default_map_red.tga.meta b/Example Materials/Textures/scsg_default_map_red.tga.meta
new file mode 100644
index 00000000..a0256eaa
--- /dev/null
+++ b/Example Materials/Textures/scsg_default_map_red.tga.meta
@@ -0,0 +1,57 @@
+fileFormatVersion: 2
+guid: 728d23cbb90607c45bdb995b6d24f727
+timeCreated: 1522286802
+licenseType: Free
+TextureImporter:
+ fileIDToRecycleName: {}
+ serializedVersion: 2
+ mipmaps:
+ mipMapMode: 0
+ enableMipMap: 1
+ linearTexture: 0
+ correctGamma: 0
+ fadeOut: 0
+ borderMipMap: 0
+ mipMapFadeDistanceStart: 1
+ mipMapFadeDistanceEnd: 3
+ bumpmap:
+ convertToNormalMap: 0
+ externalNormalMap: 0
+ heightScale: 0.25
+ normalMapFilter: 0
+ isReadable: 0
+ grayScaleToAlpha: 0
+ generateCubemap: 0
+ cubemapConvolution: 0
+ cubemapConvolutionSteps: 7
+ cubemapConvolutionExponent: 1.5
+ seamlessCubemap: 0
+ textureFormat: -1
+ maxTextureSize: 2048
+ textureSettings:
+ filterMode: -1
+ aniso: -1
+ mipBias: -1
+ wrapMode: -1
+ nPOTScale: 1
+ lightmap: 0
+ rGBM: 0
+ compressionQuality: 50
+ allowsAlphaSplitting: 0
+ spriteMode: 0
+ spriteExtrude: 1
+ spriteMeshType: 1
+ alignment: 0
+ spritePivot: {x: 0.5, y: 0.5}
+ spriteBorder: {x: 0, y: 0, z: 0, w: 0}
+ spritePixelsToUnits: 100
+ alphaIsTransparency: 0
+ textureType: -1
+ buildTargetSettings: []
+ spriteSheet:
+ sprites: []
+ outline: []
+ spritePackingTag:
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Example Materials/Textures/scsg_planks_0_d.tga b/Example Materials/Textures/scsg_planks_0_d.tga
new file mode 100644
index 00000000..5e5a0a98
Binary files /dev/null and b/Example Materials/Textures/scsg_planks_0_d.tga differ
diff --git a/Example Materials/Textures/scsg_planks_0_d.tga.meta b/Example Materials/Textures/scsg_planks_0_d.tga.meta
new file mode 100644
index 00000000..41f26c50
--- /dev/null
+++ b/Example Materials/Textures/scsg_planks_0_d.tga.meta
@@ -0,0 +1,57 @@
+fileFormatVersion: 2
+guid: af9769b0812737240af6dba2f662c450
+timeCreated: 1522286803
+licenseType: Free
+TextureImporter:
+ fileIDToRecycleName: {}
+ serializedVersion: 2
+ mipmaps:
+ mipMapMode: 0
+ enableMipMap: 1
+ linearTexture: 0
+ correctGamma: 0
+ fadeOut: 0
+ borderMipMap: 0
+ mipMapFadeDistanceStart: 1
+ mipMapFadeDistanceEnd: 3
+ bumpmap:
+ convertToNormalMap: 0
+ externalNormalMap: 0
+ heightScale: 0.25
+ normalMapFilter: 0
+ isReadable: 0
+ grayScaleToAlpha: 0
+ generateCubemap: 0
+ cubemapConvolution: 0
+ cubemapConvolutionSteps: 7
+ cubemapConvolutionExponent: 1.5
+ seamlessCubemap: 0
+ textureFormat: -1
+ maxTextureSize: 2048
+ textureSettings:
+ filterMode: -1
+ aniso: -1
+ mipBias: -1
+ wrapMode: -1
+ nPOTScale: 1
+ lightmap: 0
+ rGBM: 0
+ compressionQuality: 50
+ allowsAlphaSplitting: 0
+ spriteMode: 0
+ spriteExtrude: 1
+ spriteMeshType: 1
+ alignment: 0
+ spritePivot: {x: 0.5, y: 0.5}
+ spriteBorder: {x: 0, y: 0, z: 0, w: 0}
+ spritePixelsToUnits: 100
+ alphaIsTransparency: 0
+ textureType: -1
+ buildTargetSettings: []
+ spriteSheet:
+ sprites: []
+ outline: []
+ spritePackingTag:
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Example Materials/Textures/scsg_planks_0_m.tga b/Example Materials/Textures/scsg_planks_0_m.tga
new file mode 100644
index 00000000..66292b9c
Binary files /dev/null and b/Example Materials/Textures/scsg_planks_0_m.tga differ
diff --git a/Example Materials/Textures/scsg_planks_0_m.tga.meta b/Example Materials/Textures/scsg_planks_0_m.tga.meta
new file mode 100644
index 00000000..f7751f9f
--- /dev/null
+++ b/Example Materials/Textures/scsg_planks_0_m.tga.meta
@@ -0,0 +1,57 @@
+fileFormatVersion: 2
+guid: e0e282cf17e43494c975d225777142db
+timeCreated: 1522286804
+licenseType: Free
+TextureImporter:
+ fileIDToRecycleName: {}
+ serializedVersion: 2
+ mipmaps:
+ mipMapMode: 0
+ enableMipMap: 1
+ linearTexture: 0
+ correctGamma: 0
+ fadeOut: 0
+ borderMipMap: 0
+ mipMapFadeDistanceStart: 1
+ mipMapFadeDistanceEnd: 3
+ bumpmap:
+ convertToNormalMap: 0
+ externalNormalMap: 0
+ heightScale: 0.25
+ normalMapFilter: 0
+ isReadable: 0
+ grayScaleToAlpha: 0
+ generateCubemap: 0
+ cubemapConvolution: 0
+ cubemapConvolutionSteps: 7
+ cubemapConvolutionExponent: 1.5
+ seamlessCubemap: 0
+ textureFormat: -1
+ maxTextureSize: 2048
+ textureSettings:
+ filterMode: -1
+ aniso: -1
+ mipBias: -1
+ wrapMode: -1
+ nPOTScale: 1
+ lightmap: 0
+ rGBM: 0
+ compressionQuality: 50
+ allowsAlphaSplitting: 0
+ spriteMode: 0
+ spriteExtrude: 1
+ spriteMeshType: 1
+ alignment: 0
+ spritePivot: {x: 0.5, y: 0.5}
+ spriteBorder: {x: 0, y: 0, z: 0, w: 0}
+ spritePixelsToUnits: 100
+ alphaIsTransparency: 0
+ textureType: -1
+ buildTargetSettings: []
+ spriteSheet:
+ sprites: []
+ outline: []
+ spritePackingTag:
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Example Materials/Textures/scsg_planks_0_n.tga b/Example Materials/Textures/scsg_planks_0_n.tga
new file mode 100644
index 00000000..6afd7519
Binary files /dev/null and b/Example Materials/Textures/scsg_planks_0_n.tga differ
diff --git a/Example Materials/Textures/Bricksmooth_N.png.meta b/Example Materials/Textures/scsg_planks_0_n.tga.meta
similarity index 90%
rename from Example Materials/Textures/Bricksmooth_N.png.meta
rename to Example Materials/Textures/scsg_planks_0_n.tga.meta
index 70d5e1f7..58c36324 100644
--- a/Example Materials/Textures/Bricksmooth_N.png.meta
+++ b/Example Materials/Textures/scsg_planks_0_n.tga.meta
@@ -1,6 +1,6 @@
fileFormatVersion: 2
-guid: f01935cef2d114d65b6c6e1c38559720
-timeCreated: 1442059656
+guid: 091fc14d3cb4fd8459bc8b7e992e50ed
+timeCreated: 1522286951
licenseType: Free
TextureImporter:
fileIDToRecycleName: {}
@@ -23,10 +23,10 @@ TextureImporter:
grayScaleToAlpha: 0
generateCubemap: 0
cubemapConvolution: 0
- cubemapConvolutionSteps: 8
+ cubemapConvolutionSteps: 7
cubemapConvolutionExponent: 1.5
seamlessCubemap: 0
- textureFormat: -3
+ textureFormat: -1
maxTextureSize: 2048
textureSettings:
filterMode: -1
diff --git a/Example Materials/Textures/scsg_planks_1_d.tga b/Example Materials/Textures/scsg_planks_1_d.tga
new file mode 100644
index 00000000..37219428
Binary files /dev/null and b/Example Materials/Textures/scsg_planks_1_d.tga differ
diff --git a/Example Materials/Textures/scsg_planks_1_d.tga.meta b/Example Materials/Textures/scsg_planks_1_d.tga.meta
new file mode 100644
index 00000000..da2b97cb
--- /dev/null
+++ b/Example Materials/Textures/scsg_planks_1_d.tga.meta
@@ -0,0 +1,57 @@
+fileFormatVersion: 2
+guid: 5fc34faead95a864880618c4bdeea39d
+timeCreated: 1522286802
+licenseType: Free
+TextureImporter:
+ fileIDToRecycleName: {}
+ serializedVersion: 2
+ mipmaps:
+ mipMapMode: 0
+ enableMipMap: 1
+ linearTexture: 0
+ correctGamma: 0
+ fadeOut: 0
+ borderMipMap: 0
+ mipMapFadeDistanceStart: 1
+ mipMapFadeDistanceEnd: 3
+ bumpmap:
+ convertToNormalMap: 0
+ externalNormalMap: 0
+ heightScale: 0.25
+ normalMapFilter: 0
+ isReadable: 0
+ grayScaleToAlpha: 0
+ generateCubemap: 0
+ cubemapConvolution: 0
+ cubemapConvolutionSteps: 7
+ cubemapConvolutionExponent: 1.5
+ seamlessCubemap: 0
+ textureFormat: -1
+ maxTextureSize: 2048
+ textureSettings:
+ filterMode: -1
+ aniso: -1
+ mipBias: -1
+ wrapMode: -1
+ nPOTScale: 1
+ lightmap: 0
+ rGBM: 0
+ compressionQuality: 50
+ allowsAlphaSplitting: 0
+ spriteMode: 0
+ spriteExtrude: 1
+ spriteMeshType: 1
+ alignment: 0
+ spritePivot: {x: 0.5, y: 0.5}
+ spriteBorder: {x: 0, y: 0, z: 0, w: 0}
+ spritePixelsToUnits: 100
+ alphaIsTransparency: 0
+ textureType: -1
+ buildTargetSettings: []
+ spriteSheet:
+ sprites: []
+ outline: []
+ spritePackingTag:
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Example Materials/Textures/scsg_planks_1_m.tga b/Example Materials/Textures/scsg_planks_1_m.tga
new file mode 100644
index 00000000..75c193d6
Binary files /dev/null and b/Example Materials/Textures/scsg_planks_1_m.tga differ
diff --git a/Example Materials/Textures/scsg_planks_1_m.tga.meta b/Example Materials/Textures/scsg_planks_1_m.tga.meta
new file mode 100644
index 00000000..9ec42878
--- /dev/null
+++ b/Example Materials/Textures/scsg_planks_1_m.tga.meta
@@ -0,0 +1,57 @@
+fileFormatVersion: 2
+guid: f76f06c6b7257764286e92a1d94112af
+timeCreated: 1522286804
+licenseType: Free
+TextureImporter:
+ fileIDToRecycleName: {}
+ serializedVersion: 2
+ mipmaps:
+ mipMapMode: 0
+ enableMipMap: 1
+ linearTexture: 0
+ correctGamma: 0
+ fadeOut: 0
+ borderMipMap: 0
+ mipMapFadeDistanceStart: 1
+ mipMapFadeDistanceEnd: 3
+ bumpmap:
+ convertToNormalMap: 0
+ externalNormalMap: 0
+ heightScale: 0.25
+ normalMapFilter: 0
+ isReadable: 0
+ grayScaleToAlpha: 0
+ generateCubemap: 0
+ cubemapConvolution: 0
+ cubemapConvolutionSteps: 7
+ cubemapConvolutionExponent: 1.5
+ seamlessCubemap: 0
+ textureFormat: -1
+ maxTextureSize: 2048
+ textureSettings:
+ filterMode: -1
+ aniso: -1
+ mipBias: -1
+ wrapMode: -1
+ nPOTScale: 1
+ lightmap: 0
+ rGBM: 0
+ compressionQuality: 50
+ allowsAlphaSplitting: 0
+ spriteMode: 0
+ spriteExtrude: 1
+ spriteMeshType: 1
+ alignment: 0
+ spritePivot: {x: 0.5, y: 0.5}
+ spriteBorder: {x: 0, y: 0, z: 0, w: 0}
+ spritePixelsToUnits: 100
+ alphaIsTransparency: 0
+ textureType: -1
+ buildTargetSettings: []
+ spriteSheet:
+ sprites: []
+ outline: []
+ spritePackingTag:
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Example Materials/Textures/scsg_planks_1_n.tga b/Example Materials/Textures/scsg_planks_1_n.tga
new file mode 100644
index 00000000..ea7a55bc
Binary files /dev/null and b/Example Materials/Textures/scsg_planks_1_n.tga differ
diff --git a/Example Materials/Textures/scsg_planks_1_n.tga.meta b/Example Materials/Textures/scsg_planks_1_n.tga.meta
new file mode 100644
index 00000000..a1294346
--- /dev/null
+++ b/Example Materials/Textures/scsg_planks_1_n.tga.meta
@@ -0,0 +1,57 @@
+fileFormatVersion: 2
+guid: 56ecc4c928b407a4f80a22c48396fdc1
+timeCreated: 1522286980
+licenseType: Free
+TextureImporter:
+ fileIDToRecycleName: {}
+ serializedVersion: 2
+ mipmaps:
+ mipMapMode: 0
+ enableMipMap: 1
+ linearTexture: 1
+ correctGamma: 0
+ fadeOut: 0
+ borderMipMap: 0
+ mipMapFadeDistanceStart: 1
+ mipMapFadeDistanceEnd: 3
+ bumpmap:
+ convertToNormalMap: 0
+ externalNormalMap: 1
+ heightScale: 0.25
+ normalMapFilter: 0
+ isReadable: 0
+ grayScaleToAlpha: 0
+ generateCubemap: 0
+ cubemapConvolution: 0
+ cubemapConvolutionSteps: 7
+ cubemapConvolutionExponent: 1.5
+ seamlessCubemap: 0
+ textureFormat: -1
+ maxTextureSize: 2048
+ textureSettings:
+ filterMode: -1
+ aniso: -1
+ mipBias: -1
+ wrapMode: -1
+ nPOTScale: 1
+ lightmap: 0
+ rGBM: 0
+ compressionQuality: 50
+ allowsAlphaSplitting: 0
+ spriteMode: 0
+ spriteExtrude: 1
+ spriteMeshType: 1
+ alignment: 0
+ spritePivot: {x: 0.5, y: 0.5}
+ spriteBorder: {x: 0, y: 0, z: 0, w: 0}
+ spritePixelsToUnits: 100
+ alphaIsTransparency: 0
+ textureType: 1
+ buildTargetSettings: []
+ spriteSheet:
+ sprites: []
+ outline: []
+ spritePackingTag:
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Example Materials/Textures/scsg_planks_1_o.tga b/Example Materials/Textures/scsg_planks_1_o.tga
new file mode 100644
index 00000000..cd204090
Binary files /dev/null and b/Example Materials/Textures/scsg_planks_1_o.tga differ
diff --git a/Example Materials/Textures/scsg_planks_1_o.tga.meta b/Example Materials/Textures/scsg_planks_1_o.tga.meta
new file mode 100644
index 00000000..28b27e16
--- /dev/null
+++ b/Example Materials/Textures/scsg_planks_1_o.tga.meta
@@ -0,0 +1,57 @@
+fileFormatVersion: 2
+guid: 10fb91745d5dda34ca06e018683492b9
+timeCreated: 1522286800
+licenseType: Free
+TextureImporter:
+ fileIDToRecycleName: {}
+ serializedVersion: 2
+ mipmaps:
+ mipMapMode: 0
+ enableMipMap: 1
+ linearTexture: 0
+ correctGamma: 0
+ fadeOut: 0
+ borderMipMap: 0
+ mipMapFadeDistanceStart: 1
+ mipMapFadeDistanceEnd: 3
+ bumpmap:
+ convertToNormalMap: 0
+ externalNormalMap: 0
+ heightScale: 0.25
+ normalMapFilter: 0
+ isReadable: 0
+ grayScaleToAlpha: 0
+ generateCubemap: 0
+ cubemapConvolution: 0
+ cubemapConvolutionSteps: 7
+ cubemapConvolutionExponent: 1.5
+ seamlessCubemap: 0
+ textureFormat: -1
+ maxTextureSize: 2048
+ textureSettings:
+ filterMode: -1
+ aniso: -1
+ mipBias: -1
+ wrapMode: -1
+ nPOTScale: 1
+ lightmap: 0
+ rGBM: 0
+ compressionQuality: 50
+ allowsAlphaSplitting: 0
+ spriteMode: 0
+ spriteExtrude: 1
+ spriteMeshType: 1
+ alignment: 0
+ spritePivot: {x: 0.5, y: 0.5}
+ spriteBorder: {x: 0, y: 0, z: 0, w: 0}
+ spritePixelsToUnits: 100
+ alphaIsTransparency: 0
+ textureType: -1
+ buildTargetSettings: []
+ spriteSheet:
+ sprites: []
+ outline: []
+ spritePackingTag:
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Example Materials/Textures/update.txt b/Example Materials/Textures/update.txt
new file mode 100644
index 00000000..e4b31e58
--- /dev/null
+++ b/Example Materials/Textures/update.txt
@@ -0,0 +1,17 @@
+Content updated by Daniel Cornelius (Kerfuffles)
+Wood textures provided by Textures.com (formerly CGTextures.com)
+
+[3.28.2018]
+* fixed wrong project version - was using the wrong version of unity and had .meta issues with older versions.
+* added credit for wood textures to the top of update.txt
+
+[3.27.2018]
+* updated all materials
+* updated all textures
+* updated default materials to use mobile diffuse shaders
+* updated naming of materials and textures to help when searching for other content in a project
+* updated default material textures to correspond to their names more accurately
+* converted all textures to targa and adjusted their alpha channels where appropriate
++ added black material
+- removed old materials
+- removed old textures
\ No newline at end of file
diff --git a/Changelog.txt.meta b/Example Materials/Textures/update.txt.meta
similarity index 64%
rename from Changelog.txt.meta
rename to Example Materials/Textures/update.txt.meta
index fd5a7109..7f5b8589 100644
--- a/Changelog.txt.meta
+++ b/Example Materials/Textures/update.txt.meta
@@ -1,6 +1,6 @@
fileFormatVersion: 2
-guid: 8efb6caa64f9b488aba6a8d4965d1efa
-timeCreated: 1466691621
+guid: 0c50319e406d5144385e584e08ab11ae
+timeCreated: 1522286804
licenseType: Free
TextScriptImporter:
userData:
diff --git a/Example Materials/lambert1.mat b/Example Materials/lambert1.mat
deleted file mode 100644
index 15420161..00000000
--- a/Example Materials/lambert1.mat
+++ /dev/null
@@ -1,127 +0,0 @@
-%YAML 1.1
-%TAG !u! tag:unity3d.com,2011:
---- !u!21 &2100000
-Material:
- serializedVersion: 6
- m_ObjectHideFlags: 0
- m_PrefabParentObject: {fileID: 0}
- m_PrefabInternal: {fileID: 0}
- m_Name: lambert1
- m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0}
- m_ShaderKeywords: _EMISSION _NORMALMAP
- m_LightmapFlags: 1
- m_CustomRenderQueue: -1
- stringTagMap: {}
- m_SavedProperties:
- serializedVersion: 2
- m_TexEnvs:
- - first:
- name: _BumpMap
- second:
- m_Texture: {fileID: 2800000, guid: b55d4524f543a4b63902a71e67a16a8b, type: 3}
- m_Scale: {x: 1, y: 1}
- m_Offset: {x: 0, y: 0}
- - first:
- name: _DetailAlbedoMap
- second:
- m_Texture: {fileID: 0}
- m_Scale: {x: 1, y: 1}
- m_Offset: {x: 0, y: 0}
- - first:
- name: _DetailMask
- second:
- m_Texture: {fileID: 0}
- m_Scale: {x: 1, y: 1}
- m_Offset: {x: 0, y: 0}
- - first:
- name: _DetailNormalMap
- second:
- m_Texture: {fileID: 0}
- m_Scale: {x: 1, y: 1}
- m_Offset: {x: 0, y: 0}
- - first:
- name: _EmissionMap
- second:
- m_Texture: {fileID: 0}
- m_Scale: {x: 1, y: 1}
- m_Offset: {x: 0, y: 0}
- - first:
- name: _MainTex
- second:
- m_Texture: {fileID: 2800000, guid: 865e653fc118e42bdb478e709b97134b, type: 3}
- m_Scale: {x: 1, y: 1}
- m_Offset: {x: 0, y: 0}
- - first:
- name: _MetallicGlossMap
- second:
- m_Texture: {fileID: 0}
- m_Scale: {x: 1, y: 1}
- m_Offset: {x: 0, y: 0}
- - first:
- name: _OcclusionMap
- second:
- m_Texture: {fileID: 0}
- m_Scale: {x: 1, y: 1}
- m_Offset: {x: 0, y: 0}
- - first:
- name: _ParallaxMap
- second:
- m_Texture: {fileID: 0}
- m_Scale: {x: 1, y: 1}
- m_Offset: {x: 0, y: 0}
- m_Floats:
- - first:
- name: _BumpScale
- second: 1
- - first:
- name: _Cutoff
- second: 0.5
- - first:
- name: _DetailNormalMapScale
- second: 1
- - first:
- name: _DstBlend
- second: 0
- - first:
- name: _GlossMapScale
- second: 1
- - first:
- name: _Glossiness
- second: 0.5
- - first:
- name: _GlossyReflections
- second: 1
- - first:
- name: _Metallic
- second: 0
- - first:
- name: _Mode
- second: 0
- - first:
- name: _OcclusionStrength
- second: 1
- - first:
- name: _Parallax
- second: 0.02
- - first:
- name: _SmoothnessTextureChannel
- second: 0
- - first:
- name: _SpecularHighlights
- second: 1
- - first:
- name: _SrcBlend
- second: 1
- - first:
- name: _UVSec
- second: 0
- - first:
- name: _ZWrite
- second: 1
- m_Colors:
- - first:
- name: _Color
- second: {r: 1, g: 1, b: 1, a: 1}
- - first:
- name: _EmissionColor
- second: {r: 0, g: 0, b: 0, a: 1}
diff --git a/Example Materials/lambert1.mat.meta b/Example Materials/lambert1.mat.meta
deleted file mode 100644
index 9b053a59..00000000
--- a/Example Materials/lambert1.mat.meta
+++ /dev/null
@@ -1,8 +0,0 @@
-fileFormatVersion: 2
-guid: a72c410acd75c47a5b984cbba98a8345
-timeCreated: 1442060190
-licenseType: Free
-NativeFormatImporter:
- userData:
- assetBundleName:
- assetBundleVariant:
diff --git a/Example Materials/scsg_black.mat b/Example Materials/scsg_black.mat
new file mode 100644
index 00000000..95a57a51
--- /dev/null
+++ b/Example Materials/scsg_black.mat
@@ -0,0 +1,23 @@
+%YAML 1.1
+%TAG !u! tag:unity3d.com,2011:
+--- !u!21 &2100000
+Material:
+ serializedVersion: 6
+ m_ObjectHideFlags: 0
+ m_PrefabParentObject: {fileID: 0}
+ m_PrefabInternal: {fileID: 0}
+ m_Name: scsg_black
+ m_Shader: {fileID: 10755, guid: 0000000000000000f000000000000000, type: 0}
+ m_ShaderKeywords:
+ m_LightmapFlags: 4
+ m_CustomRenderQueue: -1
+ stringTagMap: {}
+ m_SavedProperties:
+ serializedVersion: 2
+ m_TexEnvs: {}
+ m_Floats: {}
+ m_Colors:
+ data:
+ first:
+ name: _Color
+ second: {r: 0, g: 0, b: 0, a: 1}
diff --git a/Example Materials/Bricksmooth.mat.meta b/Example Materials/scsg_black.mat.meta
similarity index 52%
rename from Example Materials/Bricksmooth.mat.meta
rename to Example Materials/scsg_black.mat.meta
index d1c11001..9b8a5847 100644
--- a/Example Materials/Bricksmooth.mat.meta
+++ b/Example Materials/scsg_black.mat.meta
@@ -1,8 +1,10 @@
fileFormatVersion: 2
-guid: 1a4acdb6c13bb40ec96d9ba8f86c21e1
-timeCreated: 1442059792
+guid: 0e8665057841d2941967f9c75c25b26a
+timeCreated: 1522131906
licenseType: Free
NativeFormatImporter:
+ externalObjects: {}
+ mainObjectFileID: 0
userData:
assetBundleName:
assetBundleVariant:
diff --git a/Example Materials/scsg_bricks_0.mat b/Example Materials/scsg_bricks_0.mat
new file mode 100644
index 00000000..46d76b2f
--- /dev/null
+++ b/Example Materials/scsg_bricks_0.mat
@@ -0,0 +1,138 @@
+%YAML 1.1
+%TAG !u! tag:unity3d.com,2011:
+--- !u!21 &2100000
+Material:
+ serializedVersion: 6
+ m_ObjectHideFlags: 0
+ m_PrefabParentObject: {fileID: 0}
+ m_PrefabInternal: {fileID: 0}
+ m_Name: scsg_bricks_0
+ m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0}
+ m_ShaderKeywords: _DETAIL_MULX2 _METALLICGLOSSMAP _NORMALMAP
+ m_LightmapFlags: 4
+ m_CustomRenderQueue: -1
+ stringTagMap: {}
+ m_SavedProperties:
+ serializedVersion: 2
+ m_TexEnvs:
+ data:
+ first:
+ name: _MainTex
+ second:
+ m_Texture: {fileID: 2800000, guid: 2a7fb32a0866ac04894b42589662a4b8, type: 3}
+ m_Scale: {x: 1, y: 1}
+ m_Offset: {x: 0, y: 0}
+ data:
+ first:
+ name: _BumpMap
+ second:
+ m_Texture: {fileID: 2800000, guid: 90bb2075cc819e2479d0286ac978cc6e, type: 3}
+ m_Scale: {x: 1, y: 1}
+ m_Offset: {x: 0, y: 0}
+ data:
+ first:
+ name: _DetailNormalMap
+ second:
+ m_Texture: {fileID: 2800000, guid: 69a672569f3684c46aedfaadba2bdca2, type: 3}
+ m_Scale: {x: 1, y: 1}
+ m_Offset: {x: 0, y: 0}
+ data:
+ first:
+ name: _MetallicGlossMap
+ second:
+ m_Texture: {fileID: 2800000, guid: 3353858f61a67cd4c9d99784f76e8e66, type: 3}
+ m_Scale: {x: 1, y: 1}
+ m_Offset: {x: 0, y: 0}
+ data:
+ first:
+ name: _ParallaxMap
+ second:
+ m_Texture: {fileID: 0}
+ m_Scale: {x: 1, y: 1}
+ m_Offset: {x: 0, y: 0}
+ data:
+ first:
+ name: _OcclusionMap
+ second:
+ m_Texture: {fileID: 2800000, guid: 015d3ae8bb7fdc24586590079f00191e, type: 3}
+ m_Scale: {x: 1, y: 1}
+ m_Offset: {x: 0, y: 0}
+ data:
+ first:
+ name: _EmissionMap
+ second:
+ m_Texture: {fileID: 0}
+ m_Scale: {x: 1, y: 1}
+ m_Offset: {x: 0, y: 0}
+ data:
+ first:
+ name: _DetailMask
+ second:
+ m_Texture: {fileID: 0}
+ m_Scale: {x: 1, y: 1}
+ m_Offset: {x: 0, y: 0}
+ data:
+ first:
+ name: _DetailAlbedoMap
+ second:
+ m_Texture: {fileID: 2800000, guid: 55f9a5d4d58ec754e80dc2210c213ff5, type: 3}
+ m_Scale: {x: 1, y: 1}
+ m_Offset: {x: 0, y: 0}
+ m_Floats:
+ data:
+ first:
+ name: _SrcBlend
+ second: 1
+ data:
+ first:
+ name: _DstBlend
+ second: 0
+ data:
+ first:
+ name: _Cutoff
+ second: 0.5
+ data:
+ first:
+ name: _Glossiness
+ second: 0.5
+ data:
+ first:
+ name: _Metallic
+ second: 0
+ data:
+ first:
+ name: _ZWrite
+ second: 1
+ data:
+ first:
+ name: _BumpScale
+ second: 1
+ data:
+ first:
+ name: _Parallax
+ second: 0.02
+ data:
+ first:
+ name: _OcclusionStrength
+ second: 0.689
+ data:
+ first:
+ name: _DetailNormalMapScale
+ second: 1
+ data:
+ first:
+ name: _UVSec
+ second: 0
+ data:
+ first:
+ name: _Mode
+ second: 0
+ m_Colors:
+ data:
+ first:
+ name: _EmissionColor
+ second: {r: 0, g: 0, b: 0, a: 1}
+ data:
+ first:
+ name: _Color
+ second: {r: 1, g: 1, b: 1, a: 1}
diff --git a/Example Materials/Default_Map_Grey.mat.meta b/Example Materials/scsg_bricks_0.mat.meta
similarity index 52%
rename from Example Materials/Default_Map_Grey.mat.meta
rename to Example Materials/scsg_bricks_0.mat.meta
index 0ff1c3c8..6a17850b 100644
--- a/Example Materials/Default_Map_Grey.mat.meta
+++ b/Example Materials/scsg_bricks_0.mat.meta
@@ -1,8 +1,10 @@
fileFormatVersion: 2
-guid: 5d183e271493e4e988b8df27b1197056
-timeCreated: 1450706018
+guid: 391688459a53ab741b5d286d68f4236a
+timeCreated: 1522131906
licenseType: Free
NativeFormatImporter:
+ externalObjects: {}
+ mainObjectFileID: 0
userData:
assetBundleName:
assetBundleVariant:
diff --git a/Example Materials/scsg_bricks_1.mat b/Example Materials/scsg_bricks_1.mat
new file mode 100644
index 00000000..027c82f7
--- /dev/null
+++ b/Example Materials/scsg_bricks_1.mat
@@ -0,0 +1,138 @@
+%YAML 1.1
+%TAG !u! tag:unity3d.com,2011:
+--- !u!21 &2100000
+Material:
+ serializedVersion: 6
+ m_ObjectHideFlags: 0
+ m_PrefabParentObject: {fileID: 0}
+ m_PrefabInternal: {fileID: 0}
+ m_Name: scsg_bricks_1
+ m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0}
+ m_ShaderKeywords: _METALLICGLOSSMAP _NORMALMAP
+ m_LightmapFlags: 4
+ m_CustomRenderQueue: -1
+ stringTagMap: {}
+ m_SavedProperties:
+ serializedVersion: 2
+ m_TexEnvs:
+ data:
+ first:
+ name: _MainTex
+ second:
+ m_Texture: {fileID: 2800000, guid: b81a4798a14591a448b6c21a1eb340b4, type: 3}
+ m_Scale: {x: 1, y: 1}
+ m_Offset: {x: 0, y: 0}
+ data:
+ first:
+ name: _BumpMap
+ second:
+ m_Texture: {fileID: 2800000, guid: 0032764f85b91f64e83dd49c3a74a7e7, type: 3}
+ m_Scale: {x: 1, y: 1}
+ m_Offset: {x: 0, y: 0}
+ data:
+ first:
+ name: _DetailNormalMap
+ second:
+ m_Texture: {fileID: 0}
+ m_Scale: {x: 1, y: 1}
+ m_Offset: {x: 0, y: 0}
+ data:
+ first:
+ name: _MetallicGlossMap
+ second:
+ m_Texture: {fileID: 2800000, guid: 80a6fb8fc412b8e4584281c08b695f30, type: 3}
+ m_Scale: {x: 1, y: 1}
+ m_Offset: {x: 0, y: 0}
+ data:
+ first:
+ name: _ParallaxMap
+ second:
+ m_Texture: {fileID: 0}
+ m_Scale: {x: 1, y: 1}
+ m_Offset: {x: 0, y: 0}
+ data:
+ first:
+ name: _OcclusionMap
+ second:
+ m_Texture: {fileID: 2800000, guid: fce541d616219a543b85f2136008491a, type: 3}
+ m_Scale: {x: 1, y: 1}
+ m_Offset: {x: 0, y: 0}
+ data:
+ first:
+ name: _EmissionMap
+ second:
+ m_Texture: {fileID: 0}
+ m_Scale: {x: 1, y: 1}
+ m_Offset: {x: 0, y: 0}
+ data:
+ first:
+ name: _DetailMask
+ second:
+ m_Texture: {fileID: 0}
+ m_Scale: {x: 1, y: 1}
+ m_Offset: {x: 0, y: 0}
+ data:
+ first:
+ name: _DetailAlbedoMap
+ second:
+ m_Texture: {fileID: 0}
+ m_Scale: {x: 1, y: 1}
+ m_Offset: {x: 0, y: 0}
+ m_Floats:
+ data:
+ first:
+ name: _SrcBlend
+ second: 1
+ data:
+ first:
+ name: _DstBlend
+ second: 0
+ data:
+ first:
+ name: _Cutoff
+ second: 0.5
+ data:
+ first:
+ name: _Glossiness
+ second: 0.5
+ data:
+ first:
+ name: _Metallic
+ second: 0
+ data:
+ first:
+ name: _ZWrite
+ second: 1
+ data:
+ first:
+ name: _BumpScale
+ second: 1
+ data:
+ first:
+ name: _Parallax
+ second: 0.02
+ data:
+ first:
+ name: _OcclusionStrength
+ second: 0.496
+ data:
+ first:
+ name: _DetailNormalMapScale
+ second: 1
+ data:
+ first:
+ name: _UVSec
+ second: 0
+ data:
+ first:
+ name: _Mode
+ second: 0
+ m_Colors:
+ data:
+ first:
+ name: _EmissionColor
+ second: {r: 0, g: 0, b: 0, a: 1}
+ data:
+ first:
+ name: _Color
+ second: {r: 1, g: 1, b: 1, a: 1}
diff --git a/Example Materials/Default_Map_Blue.mat.meta b/Example Materials/scsg_bricks_1.mat.meta
similarity index 52%
rename from Example Materials/Default_Map_Blue.mat.meta
rename to Example Materials/scsg_bricks_1.mat.meta
index 0931052b..49be8cd7 100644
--- a/Example Materials/Default_Map_Blue.mat.meta
+++ b/Example Materials/scsg_bricks_1.mat.meta
@@ -1,8 +1,10 @@
fileFormatVersion: 2
-guid: e3c00a71048f24b2f990776b26eb586d
-timeCreated: 1442060902
+guid: 1cbea93bab7a05749bd23c4408d0792a
+timeCreated: 1522131906
licenseType: Free
NativeFormatImporter:
+ externalObjects: {}
+ mainObjectFileID: 0
userData:
assetBundleName:
assetBundleVariant:
diff --git a/Example Materials/Default_Map_PaleBlue.mat b/Example Materials/scsg_defaultmaterial_blue.mat
similarity index 93%
rename from Example Materials/Default_Map_PaleBlue.mat
rename to Example Materials/scsg_defaultmaterial_blue.mat
index 1cc9f96a..9985cc40 100644
--- a/Example Materials/Default_Map_PaleBlue.mat
+++ b/Example Materials/scsg_defaultmaterial_blue.mat
@@ -6,10 +6,10 @@ Material:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
- m_Name: Default_Map_PaleBlue
+ m_Name: scsg_defaultmaterial_blue
m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0}
m_ShaderKeywords:
- m_LightmapFlags: 5
+ m_LightmapFlags: 4
m_CustomRenderQueue: -1
stringTagMap: {}
m_SavedProperties:
@@ -19,7 +19,7 @@ Material:
first:
name: _MainTex
second:
- m_Texture: {fileID: 2800000, guid: e74ed056bfe91423bbb20a4ba62dad0c, type: 3}
+ m_Texture: {fileID: 2800000, guid: a76ef12d19981244fa01a5976ed56df9, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
data:
@@ -90,11 +90,11 @@ Material:
data:
first:
name: _Cutoff
- second: .5
+ second: 0.5
data:
first:
name: _Parallax
- second: .0199999996
+ second: 0.02
data:
first:
name: _ZWrite
@@ -102,7 +102,7 @@ Material:
data:
first:
name: _Glossiness
- second: .5
+ second: 0.365
data:
first:
name: _BumpScale
diff --git a/Example Materials/Brick.mat.meta b/Example Materials/scsg_defaultmaterial_blue.mat.meta
similarity index 52%
rename from Example Materials/Brick.mat.meta
rename to Example Materials/scsg_defaultmaterial_blue.mat.meta
index aa92e358..81c7deac 100644
--- a/Example Materials/Brick.mat.meta
+++ b/Example Materials/scsg_defaultmaterial_blue.mat.meta
@@ -1,8 +1,10 @@
fileFormatVersion: 2
-guid: 8f032e6d2ebf04782b629996289e009b
-timeCreated: 1442059783
+guid: c11485e230b79f147b6b04cee2e77440
+timeCreated: 1522131907
licenseType: Free
NativeFormatImporter:
+ externalObjects: {}
+ mainObjectFileID: 0
userData:
assetBundleName:
assetBundleVariant:
diff --git a/Example Materials/Default_Map_Blue.mat b/Example Materials/scsg_defaultmaterial_cyan.mat
similarity index 93%
rename from Example Materials/Default_Map_Blue.mat
rename to Example Materials/scsg_defaultmaterial_cyan.mat
index fcf7f18f..3a45a774 100644
--- a/Example Materials/Default_Map_Blue.mat
+++ b/Example Materials/scsg_defaultmaterial_cyan.mat
@@ -6,10 +6,10 @@ Material:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
- m_Name: Default_Map_Blue
+ m_Name: scsg_defaultmaterial_cyan
m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0}
m_ShaderKeywords:
- m_LightmapFlags: 5
+ m_LightmapFlags: 4
m_CustomRenderQueue: -1
stringTagMap: {}
m_SavedProperties:
@@ -19,7 +19,7 @@ Material:
first:
name: _MainTex
second:
- m_Texture: {fileID: 2800000, guid: 742d262fda73f49e582c4ee563ab00e6, type: 3}
+ m_Texture: {fileID: 2800000, guid: a322c74676422ab4d8c3c604778cd532, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
data:
@@ -90,11 +90,11 @@ Material:
data:
first:
name: _Cutoff
- second: .5
+ second: 0.5
data:
first:
name: _Parallax
- second: .0199999996
+ second: 0.02
data:
first:
name: _ZWrite
@@ -102,7 +102,7 @@ Material:
data:
first:
name: _Glossiness
- second: .5
+ second: 0.365
data:
first:
name: _BumpScale
diff --git a/Example Materials/scsg_defaultmaterial_cyan.mat.meta b/Example Materials/scsg_defaultmaterial_cyan.mat.meta
new file mode 100644
index 00000000..d81d5141
--- /dev/null
+++ b/Example Materials/scsg_defaultmaterial_cyan.mat.meta
@@ -0,0 +1,10 @@
+fileFormatVersion: 2
+guid: 02c0737bf00317d4084c9cd9982eb01f
+timeCreated: 1522131906
+licenseType: Free
+NativeFormatImporter:
+ externalObjects: {}
+ mainObjectFileID: 0
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Example Materials/Default_Map_Purple.mat b/Example Materials/scsg_defaultmaterial_grey.mat
similarity index 93%
rename from Example Materials/Default_Map_Purple.mat
rename to Example Materials/scsg_defaultmaterial_grey.mat
index 25327677..e3d4f211 100644
--- a/Example Materials/Default_Map_Purple.mat
+++ b/Example Materials/scsg_defaultmaterial_grey.mat
@@ -6,10 +6,10 @@ Material:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
- m_Name: Default_Map_Purple
+ m_Name: scsg_defaultmaterial_grey
m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0}
m_ShaderKeywords:
- m_LightmapFlags: 5
+ m_LightmapFlags: 4
m_CustomRenderQueue: -1
stringTagMap: {}
m_SavedProperties:
@@ -19,7 +19,7 @@ Material:
first:
name: _MainTex
second:
- m_Texture: {fileID: 2800000, guid: c355a8222563c41d7a3c6cfa9c9cb23a, type: 3}
+ m_Texture: {fileID: 2800000, guid: f7731c2f2a066b1409997521e9be5d92, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
data:
@@ -90,11 +90,11 @@ Material:
data:
first:
name: _Cutoff
- second: .5
+ second: 0.5
data:
first:
name: _Parallax
- second: .0199999996
+ second: 0.02
data:
first:
name: _ZWrite
@@ -102,7 +102,7 @@ Material:
data:
first:
name: _Glossiness
- second: .5
+ second: 0.365
data:
first:
name: _BumpScale
diff --git a/Example Materials/scsg_defaultmaterial_grey.mat.meta b/Example Materials/scsg_defaultmaterial_grey.mat.meta
new file mode 100644
index 00000000..7128f02f
--- /dev/null
+++ b/Example Materials/scsg_defaultmaterial_grey.mat.meta
@@ -0,0 +1,10 @@
+fileFormatVersion: 2
+guid: a3612dfc395be5b4bb7ebd52848dfaae
+timeCreated: 1522131907
+licenseType: Free
+NativeFormatImporter:
+ externalObjects: {}
+ mainObjectFileID: 0
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Example Materials/scsg_defaultmaterial_purple.mat b/Example Materials/scsg_defaultmaterial_purple.mat
new file mode 100644
index 00000000..e0bde83e
--- /dev/null
+++ b/Example Materials/scsg_defaultmaterial_purple.mat
@@ -0,0 +1,138 @@
+%YAML 1.1
+%TAG !u! tag:unity3d.com,2011:
+--- !u!21 &2100000
+Material:
+ serializedVersion: 6
+ m_ObjectHideFlags: 0
+ m_PrefabParentObject: {fileID: 0}
+ m_PrefabInternal: {fileID: 0}
+ m_Name: scsg_defaultmaterial_purple
+ m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0}
+ m_ShaderKeywords:
+ m_LightmapFlags: 4
+ m_CustomRenderQueue: -1
+ stringTagMap: {}
+ m_SavedProperties:
+ serializedVersion: 2
+ m_TexEnvs:
+ data:
+ first:
+ name: _MainTex
+ second:
+ m_Texture: {fileID: 2800000, guid: 94427715ad753ef41881b7d6a9f79b66, type: 3}
+ m_Scale: {x: 1, y: 1}
+ m_Offset: {x: 0, y: 0}
+ data:
+ first:
+ name: _BumpMap
+ second:
+ m_Texture: {fileID: 0}
+ m_Scale: {x: 1, y: 1}
+ m_Offset: {x: 0, y: 0}
+ data:
+ first:
+ name: _DetailNormalMap
+ second:
+ m_Texture: {fileID: 0}
+ m_Scale: {x: 1, y: 1}
+ m_Offset: {x: 0, y: 0}
+ data:
+ first:
+ name: _ParallaxMap
+ second:
+ m_Texture: {fileID: 0}
+ m_Scale: {x: 1, y: 1}
+ m_Offset: {x: 0, y: 0}
+ data:
+ first:
+ name: _OcclusionMap
+ second:
+ m_Texture: {fileID: 0}
+ m_Scale: {x: 1, y: 1}
+ m_Offset: {x: 0, y: 0}
+ data:
+ first:
+ name: _EmissionMap
+ second:
+ m_Texture: {fileID: 0}
+ m_Scale: {x: 1, y: 1}
+ m_Offset: {x: 0, y: 0}
+ data:
+ first:
+ name: _DetailMask
+ second:
+ m_Texture: {fileID: 0}
+ m_Scale: {x: 1, y: 1}
+ m_Offset: {x: 0, y: 0}
+ data:
+ first:
+ name: _DetailAlbedoMap
+ second:
+ m_Texture: {fileID: 0}
+ m_Scale: {x: 1, y: 1}
+ m_Offset: {x: 0, y: 0}
+ data:
+ first:
+ name: _MetallicGlossMap
+ second:
+ m_Texture: {fileID: 0}
+ m_Scale: {x: 1, y: 1}
+ m_Offset: {x: 0, y: 0}
+ m_Floats:
+ data:
+ first:
+ name: _SrcBlend
+ second: 1
+ data:
+ first:
+ name: _DstBlend
+ second: 0
+ data:
+ first:
+ name: _Cutoff
+ second: 0.5
+ data:
+ first:
+ name: _Parallax
+ second: 0.02
+ data:
+ first:
+ name: _ZWrite
+ second: 1
+ data:
+ first:
+ name: _Glossiness
+ second: 0.365
+ data:
+ first:
+ name: _BumpScale
+ second: 1
+ data:
+ first:
+ name: _OcclusionStrength
+ second: 1
+ data:
+ first:
+ name: _DetailNormalMapScale
+ second: 1
+ data:
+ first:
+ name: _UVSec
+ second: 0
+ data:
+ first:
+ name: _Mode
+ second: 0
+ data:
+ first:
+ name: _Metallic
+ second: 0
+ m_Colors:
+ data:
+ first:
+ name: _EmissionColor
+ second: {r: 0, g: 0, b: 0, a: 1}
+ data:
+ first:
+ name: _Color
+ second: {r: 1, g: 1, b: 1, a: 1}
diff --git a/Example Materials/scsg_defaultmaterial_purple.mat.meta b/Example Materials/scsg_defaultmaterial_purple.mat.meta
new file mode 100644
index 00000000..2b8539a5
--- /dev/null
+++ b/Example Materials/scsg_defaultmaterial_purple.mat.meta
@@ -0,0 +1,10 @@
+fileFormatVersion: 2
+guid: 355f39a1ac320f44095c58db21c4d6fd
+timeCreated: 1522131906
+licenseType: Free
+NativeFormatImporter:
+ externalObjects: {}
+ mainObjectFileID: 0
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Example Materials/Default_Map_Grey.mat b/Example Materials/scsg_defaultmaterial_red.mat
similarity index 94%
rename from Example Materials/Default_Map_Grey.mat
rename to Example Materials/scsg_defaultmaterial_red.mat
index 8697d631..c62ff861 100644
--- a/Example Materials/Default_Map_Grey.mat
+++ b/Example Materials/scsg_defaultmaterial_red.mat
@@ -6,10 +6,10 @@ Material:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
- m_Name: Default_Map_Grey
+ m_Name: scsg_defaultmaterial_red
m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0}
m_ShaderKeywords:
- m_LightmapFlags: 5
+ m_LightmapFlags: 4
m_CustomRenderQueue: -1
stringTagMap: {}
m_SavedProperties:
@@ -19,7 +19,7 @@ Material:
first:
name: _MainTex
second:
- m_Texture: {fileID: 2800000, guid: 459f141e45d4345f1b14462a560d9520, type: 3}
+ m_Texture: {fileID: 2800000, guid: 728d23cbb90607c45bdb995b6d24f727, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
data:
@@ -102,7 +102,7 @@ Material:
data:
first:
name: _Glossiness
- second: 0.5
+ second: 0.365
data:
first:
name: _BumpScale
diff --git a/Example Materials/scsg_defaultmaterial_red.mat.meta b/Example Materials/scsg_defaultmaterial_red.mat.meta
new file mode 100644
index 00000000..ae49f026
--- /dev/null
+++ b/Example Materials/scsg_defaultmaterial_red.mat.meta
@@ -0,0 +1,10 @@
+fileFormatVersion: 2
+guid: 8a27828de5a6f314a94962886ec3d659
+timeCreated: 1522131907
+licenseType: Free
+NativeFormatImporter:
+ externalObjects: {}
+ mainObjectFileID: 0
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Example Materials/Bricksmooth.mat b/Example Materials/scsg_planks_0.mat
similarity index 87%
rename from Example Materials/Bricksmooth.mat
rename to Example Materials/scsg_planks_0.mat
index cd6852a0..790dd3f0 100644
--- a/Example Materials/Bricksmooth.mat
+++ b/Example Materials/scsg_planks_0.mat
@@ -6,10 +6,10 @@ Material:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
- m_Name: Bricksmooth
+ m_Name: scsg_planks_0
m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0}
- m_ShaderKeywords: _NORMALMAP
- m_LightmapFlags: 5
+ m_ShaderKeywords: _METALLICGLOSSMAP _NORMALMAP
+ m_LightmapFlags: 4
m_CustomRenderQueue: -1
stringTagMap: {}
m_SavedProperties:
@@ -19,14 +19,14 @@ Material:
first:
name: _MainTex
second:
- m_Texture: {fileID: 2800000, guid: a07fb9adf062b4cd6bbef7ba4462450c, type: 3}
+ m_Texture: {fileID: 2800000, guid: af9769b0812737240af6dba2f662c450, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
data:
first:
name: _BumpMap
second:
- m_Texture: {fileID: 2800000, guid: f01935cef2d114d65b6c6e1c38559720, type: 3}
+ m_Texture: {fileID: 2800000, guid: 091fc14d3cb4fd8459bc8b7e992e50ed, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
data:
@@ -38,42 +38,42 @@ Material:
m_Offset: {x: 0, y: 0}
data:
first:
- name: _ParallaxMap
+ name: _MetallicGlossMap
second:
- m_Texture: {fileID: 0}
+ m_Texture: {fileID: 2800000, guid: e0e282cf17e43494c975d225777142db, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
data:
first:
- name: _OcclusionMap
+ name: _ParallaxMap
second:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
data:
first:
- name: _EmissionMap
+ name: _OcclusionMap
second:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
data:
first:
- name: _DetailMask
+ name: _EmissionMap
second:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
data:
first:
- name: _DetailAlbedoMap
+ name: _DetailMask
second:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
data:
first:
- name: _MetallicGlossMap
+ name: _DetailAlbedoMap
second:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
@@ -90,23 +90,27 @@ Material:
data:
first:
name: _Cutoff
- second: .5
+ second: 0.5
data:
first:
- name: _Parallax
- second: .0199999996
+ name: _Glossiness
+ second: 0.5
data:
first:
- name: _ZWrite
- second: 1
+ name: _Metallic
+ second: 0
data:
first:
- name: _Glossiness
- second: .5
+ name: _ZWrite
+ second: 1
data:
first:
name: _BumpScale
second: 1
+ data:
+ first:
+ name: _Parallax
+ second: 0.02
data:
first:
name: _OcclusionStrength
@@ -123,10 +127,6 @@ Material:
first:
name: _Mode
second: 0
- data:
- first:
- name: _Metallic
- second: 0
m_Colors:
data:
first:
diff --git a/Example Materials/scsg_planks_0.mat.meta b/Example Materials/scsg_planks_0.mat.meta
new file mode 100644
index 00000000..321ccbc4
--- /dev/null
+++ b/Example Materials/scsg_planks_0.mat.meta
@@ -0,0 +1,10 @@
+fileFormatVersion: 2
+guid: ec0b7a7f114fcfc4cac3fcb906d7edb2
+timeCreated: 1522131907
+licenseType: Free
+NativeFormatImporter:
+ externalObjects: {}
+ mainObjectFileID: 0
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Example Materials/Brick.mat b/Example Materials/scsg_planks_1.mat
similarity index 84%
rename from Example Materials/Brick.mat
rename to Example Materials/scsg_planks_1.mat
index 4152dd3a..697bcc05 100644
--- a/Example Materials/Brick.mat
+++ b/Example Materials/scsg_planks_1.mat
@@ -6,10 +6,10 @@ Material:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
- m_Name: Brick
+ m_Name: scsg_planks_1
m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0}
- m_ShaderKeywords: _NORMALMAP
- m_LightmapFlags: 5
+ m_ShaderKeywords: _METALLICGLOSSMAP _NORMALMAP _SPECGLOSSMAP
+ m_LightmapFlags: 4
m_CustomRenderQueue: -1
stringTagMap: {}
m_SavedProperties:
@@ -19,14 +19,14 @@ Material:
first:
name: _MainTex
second:
- m_Texture: {fileID: 2800000, guid: ed76038382bde4d33afbf6cceda43ae7, type: 3}
+ m_Texture: {fileID: 2800000, guid: 5fc34faead95a864880618c4bdeea39d, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
data:
first:
name: _BumpMap
second:
- m_Texture: {fileID: 2800000, guid: 49b9559fc6589480f98c273103741078, type: 3}
+ m_Texture: {fileID: 2800000, guid: 56ecc4c928b407a4f80a22c48396fdc1, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
data:
@@ -38,42 +38,42 @@ Material:
m_Offset: {x: 0, y: 0}
data:
first:
- name: _ParallaxMap
+ name: _MetallicGlossMap
second:
- m_Texture: {fileID: 0}
+ m_Texture: {fileID: 2800000, guid: f76f06c6b7257764286e92a1d94112af, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
data:
first:
- name: _OcclusionMap
+ name: _ParallaxMap
second:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
data:
first:
- name: _EmissionMap
+ name: _OcclusionMap
second:
- m_Texture: {fileID: 0}
+ m_Texture: {fileID: 2800000, guid: 10fb91745d5dda34ca06e018683492b9, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
data:
first:
- name: _DetailMask
+ name: _EmissionMap
second:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
data:
first:
- name: _DetailAlbedoMap
+ name: _DetailMask
second:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
data:
first:
- name: _MetallicGlossMap
+ name: _DetailAlbedoMap
second:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
@@ -90,23 +90,27 @@ Material:
data:
first:
name: _Cutoff
- second: .5
+ second: 0.5
data:
first:
- name: _Parallax
- second: .0199999996
+ name: _Glossiness
+ second: 0.5
data:
first:
- name: _ZWrite
- second: 1
+ name: _Metallic
+ second: 0
data:
first:
- name: _Glossiness
- second: .5
+ name: _ZWrite
+ second: 1
data:
first:
name: _BumpScale
second: 1
+ data:
+ first:
+ name: _Parallax
+ second: 0.02
data:
first:
name: _OcclusionStrength
@@ -123,10 +127,6 @@ Material:
first:
name: _Mode
second: 0
- data:
- first:
- name: _Metallic
- second: 0
m_Colors:
data:
first:
diff --git a/Example Materials/scsg_planks_1.mat.meta b/Example Materials/scsg_planks_1.mat.meta
new file mode 100644
index 00000000..69cc7f87
--- /dev/null
+++ b/Example Materials/scsg_planks_1.mat.meta
@@ -0,0 +1,10 @@
+fileFormatVersion: 2
+guid: 693f824b522c16046a69225b62f978cc
+timeCreated: 1522131907
+licenseType: Free
+NativeFormatImporter:
+ externalObjects: {}
+ mainObjectFileID: 0
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Gizmos/ButtonCone.png.meta b/Gizmos/ButtonCone.png.meta
index f56d6c11..289613fa 100644
--- a/Gizmos/ButtonCone.png.meta
+++ b/Gizmos/ButtonCone.png.meta
@@ -4,17 +4,14 @@ timeCreated: 1516191689
licenseType: Free
TextureImporter:
fileIDToRecycleName: {}
- externalObjects: {}
- serializedVersion: 4
+ serializedVersion: 2
mipmaps:
mipMapMode: 0
enableMipMap: 0
- sRGBTexture: 0
- linearTexture: 0
+ linearTexture: 1
+ correctGamma: 0
fadeOut: 0
borderMipMap: 0
- mipMapsPreserveCoverage: 0
- alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
@@ -24,22 +21,23 @@ TextureImporter:
normalMapFilter: 0
isReadable: 0
grayScaleToAlpha: 0
- generateCubemap: 6
+ generateCubemap: 0
cubemapConvolution: 0
+ cubemapConvolutionSteps: 7
+ cubemapConvolutionExponent: 1.5
seamlessCubemap: 0
- textureFormat: 1
+ textureFormat: -3
maxTextureSize: 2048
textureSettings:
- serializedVersion: 2
- filterMode: -1
+ filterMode: 1
aniso: 1
mipBias: -1
- wrapU: 1
- wrapV: 1
- wrapW: -1
+ wrapMode: 1
nPOTScale: 0
lightmap: 0
+ rGBM: 0
compressionQuality: 50
+ allowsAlphaSplitting: 0
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
@@ -47,40 +45,12 @@ TextureImporter:
spritePivot: {x: 0.5, y: 0.5}
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spritePixelsToUnits: 100
- alphaUsage: 1
alphaIsTransparency: 1
- spriteTessellationDetail: -1
textureType: 2
- textureShape: 1
- maxTextureSizeSet: 0
- compressionQualitySet: 0
- textureFormatSet: 0
- platformSettings:
- - buildTarget: DefaultTexturePlatform
- maxTextureSize: 2048
- resizeAlgorithm: 0
- textureFormat: -1
- textureCompression: 0
- compressionQuality: 50
- crunchedCompression: 0
- allowsAlphaSplitting: 0
- overridden: 0
- androidETC2FallbackOverride: 0
- - buildTarget: Standalone
- maxTextureSize: 2048
- resizeAlgorithm: 0
- textureFormat: -1
- textureCompression: 0
- compressionQuality: 50
- crunchedCompression: 0
- allowsAlphaSplitting: 0
- overridden: 0
- androidETC2FallbackOverride: 0
+ buildTargetSettings: []
spriteSheet:
- serializedVersion: 2
sprites: []
outline: []
- physicsShape: []
spritePackingTag:
userData:
assetBundleName:
diff --git a/Gizmos/ButtonCube.png.meta b/Gizmos/ButtonCube.png.meta
index 86161736..8dfd89ba 100644
--- a/Gizmos/ButtonCube.png.meta
+++ b/Gizmos/ButtonCube.png.meta
@@ -46,7 +46,6 @@ TextureImporter:
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spritePixelsToUnits: 100
alphaIsTransparency: 1
- spriteTessellationDetail: -1
textureType: 2
buildTargetSettings: []
spriteSheet:
diff --git a/Gizmos/ButtonCurvedStairs.png.meta b/Gizmos/ButtonCurvedStairs.png.meta
index 8ae3d6f0..eded995c 100644
--- a/Gizmos/ButtonCurvedStairs.png.meta
+++ b/Gizmos/ButtonCurvedStairs.png.meta
@@ -4,17 +4,14 @@ timeCreated: 1516366704
licenseType: Free
TextureImporter:
fileIDToRecycleName: {}
- externalObjects: {}
- serializedVersion: 4
+ serializedVersion: 2
mipmaps:
mipMapMode: 0
enableMipMap: 0
- sRGBTexture: 0
- linearTexture: 0
+ linearTexture: 1
+ correctGamma: 0
fadeOut: 0
borderMipMap: 0
- mipMapsPreserveCoverage: 0
- alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
@@ -24,22 +21,23 @@ TextureImporter:
normalMapFilter: 0
isReadable: 0
grayScaleToAlpha: 0
- generateCubemap: 6
+ generateCubemap: 0
cubemapConvolution: 0
+ cubemapConvolutionSteps: 7
+ cubemapConvolutionExponent: 1.5
seamlessCubemap: 0
- textureFormat: 1
+ textureFormat: -3
maxTextureSize: 2048
textureSettings:
- serializedVersion: 2
- filterMode: -1
+ filterMode: 1
aniso: 1
mipBias: -1
- wrapU: 1
- wrapV: 1
- wrapW: -1
+ wrapMode: 1
nPOTScale: 0
lightmap: 0
+ rGBM: 0
compressionQuality: 50
+ allowsAlphaSplitting: 0
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
@@ -47,40 +45,12 @@ TextureImporter:
spritePivot: {x: 0.5, y: 0.5}
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spritePixelsToUnits: 100
- alphaUsage: 1
alphaIsTransparency: 1
- spriteTessellationDetail: -1
textureType: 2
- textureShape: 1
- maxTextureSizeSet: 0
- compressionQualitySet: 0
- textureFormatSet: 0
- platformSettings:
- - buildTarget: DefaultTexturePlatform
- maxTextureSize: 2048
- resizeAlgorithm: 0
- textureFormat: -1
- textureCompression: 0
- compressionQuality: 50
- crunchedCompression: 0
- allowsAlphaSplitting: 0
- overridden: 0
- androidETC2FallbackOverride: 0
- - buildTarget: Standalone
- maxTextureSize: 2048
- resizeAlgorithm: 0
- textureFormat: -1
- textureCompression: 0
- compressionQuality: 50
- crunchedCompression: 0
- allowsAlphaSplitting: 0
- overridden: 0
- androidETC2FallbackOverride: 0
+ buildTargetSettings: []
spriteSheet:
- serializedVersion: 2
sprites: []
outline: []
- physicsShape: []
spritePackingTag:
userData:
assetBundleName:
diff --git a/Gizmos/ButtonCylinder.png.meta b/Gizmos/ButtonCylinder.png.meta
index c37fa4e6..e7d95398 100644
--- a/Gizmos/ButtonCylinder.png.meta
+++ b/Gizmos/ButtonCylinder.png.meta
@@ -29,7 +29,7 @@ TextureImporter:
textureFormat: -3
maxTextureSize: 2048
textureSettings:
- filterMode: -1
+ filterMode: 1
aniso: 1
mipBias: -1
wrapMode: 1
@@ -46,7 +46,6 @@ TextureImporter:
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spritePixelsToUnits: 100
alphaIsTransparency: 1
- spriteTessellationDetail: -1
textureType: 2
buildTargetSettings: []
spriteSheet:
diff --git a/Gizmos/ButtonIcoSphere.png.meta b/Gizmos/ButtonIcoSphere.png.meta
index 725ea93a..197078da 100644
--- a/Gizmos/ButtonIcoSphere.png.meta
+++ b/Gizmos/ButtonIcoSphere.png.meta
@@ -4,17 +4,14 @@ timeCreated: 1518470967
licenseType: Free
TextureImporter:
fileIDToRecycleName: {}
- externalObjects: {}
- serializedVersion: 4
+ serializedVersion: 2
mipmaps:
mipMapMode: 0
enableMipMap: 0
- sRGBTexture: 0
- linearTexture: 0
+ linearTexture: 1
+ correctGamma: 0
fadeOut: 0
borderMipMap: 0
- mipMapsPreserveCoverage: 0
- alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
@@ -24,22 +21,23 @@ TextureImporter:
normalMapFilter: 0
isReadable: 0
grayScaleToAlpha: 0
- generateCubemap: 6
+ generateCubemap: 0
cubemapConvolution: 0
+ cubemapConvolutionSteps: 7
+ cubemapConvolutionExponent: 1.5
seamlessCubemap: 0
- textureFormat: 1
+ textureFormat: -3
maxTextureSize: 2048
textureSettings:
- serializedVersion: 2
- filterMode: -1
+ filterMode: 1
aniso: 1
mipBias: -1
- wrapU: 1
- wrapV: 1
- wrapW: -1
+ wrapMode: 1
nPOTScale: 0
lightmap: 0
+ rGBM: 0
compressionQuality: 50
+ allowsAlphaSplitting: 0
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
@@ -47,40 +45,12 @@ TextureImporter:
spritePivot: {x: 0.5, y: 0.5}
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spritePixelsToUnits: 100
- alphaUsage: 1
alphaIsTransparency: 1
- spriteTessellationDetail: -1
textureType: 2
- textureShape: 1
- maxTextureSizeSet: 0
- compressionQualitySet: 0
- textureFormatSet: 0
- platformSettings:
- - buildTarget: DefaultTexturePlatform
- maxTextureSize: 2048
- resizeAlgorithm: 0
- textureFormat: -1
- textureCompression: 0
- compressionQuality: 50
- crunchedCompression: 0
- allowsAlphaSplitting: 0
- overridden: 0
- androidETC2FallbackOverride: 0
- - buildTarget: Standalone
- maxTextureSize: 2048
- resizeAlgorithm: 0
- textureFormat: -1
- textureCompression: 0
- compressionQuality: 50
- crunchedCompression: 0
- allowsAlphaSplitting: 0
- overridden: 0
- androidETC2FallbackOverride: 0
+ buildTargetSettings: []
spriteSheet:
- serializedVersion: 2
sprites: []
outline: []
- physicsShape: []
spritePackingTag:
userData:
assetBundleName:
diff --git a/Gizmos/ButtonPrism.png.meta b/Gizmos/ButtonPrism.png.meta
index b2380e84..ef8a6c66 100644
--- a/Gizmos/ButtonPrism.png.meta
+++ b/Gizmos/ButtonPrism.png.meta
@@ -29,7 +29,7 @@ TextureImporter:
textureFormat: -3
maxTextureSize: 2048
textureSettings:
- filterMode: -1
+ filterMode: 1
aniso: 1
mipBias: -1
wrapMode: 1
@@ -46,7 +46,6 @@ TextureImporter:
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spritePixelsToUnits: 100
alphaIsTransparency: 1
- spriteTessellationDetail: -1
textureType: 2
buildTargetSettings: []
spriteSheet:
diff --git a/Gizmos/ButtonShapeEditor.png.meta b/Gizmos/ButtonShapeEditor.png.meta
index d71773e1..74faa3e3 100644
--- a/Gizmos/ButtonShapeEditor.png.meta
+++ b/Gizmos/ButtonShapeEditor.png.meta
@@ -4,17 +4,14 @@ timeCreated: 1518471344
licenseType: Free
TextureImporter:
fileIDToRecycleName: {}
- externalObjects: {}
- serializedVersion: 4
+ serializedVersion: 2
mipmaps:
mipMapMode: 0
enableMipMap: 0
- sRGBTexture: 0
- linearTexture: 0
+ linearTexture: 1
+ correctGamma: 0
fadeOut: 0
borderMipMap: 0
- mipMapsPreserveCoverage: 0
- alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
@@ -24,22 +21,23 @@ TextureImporter:
normalMapFilter: 0
isReadable: 0
grayScaleToAlpha: 0
- generateCubemap: 6
+ generateCubemap: 0
cubemapConvolution: 0
+ cubemapConvolutionSteps: 7
+ cubemapConvolutionExponent: 1.5
seamlessCubemap: 0
- textureFormat: 1
+ textureFormat: -3
maxTextureSize: 2048
textureSettings:
- serializedVersion: 2
- filterMode: -1
+ filterMode: 1
aniso: 1
mipBias: -1
- wrapU: 1
- wrapV: 1
- wrapW: -1
+ wrapMode: 1
nPOTScale: 0
lightmap: 0
+ rGBM: 0
compressionQuality: 50
+ allowsAlphaSplitting: 0
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
@@ -47,40 +45,12 @@ TextureImporter:
spritePivot: {x: 0.5, y: 0.5}
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spritePixelsToUnits: 100
- alphaUsage: 1
alphaIsTransparency: 1
- spriteTessellationDetail: -1
textureType: 2
- textureShape: 1
- maxTextureSizeSet: 0
- compressionQualitySet: 0
- textureFormatSet: 0
- platformSettings:
- - buildTarget: DefaultTexturePlatform
- maxTextureSize: 2048
- resizeAlgorithm: 0
- textureFormat: -1
- textureCompression: 0
- compressionQuality: 50
- crunchedCompression: 0
- allowsAlphaSplitting: 0
- overridden: 0
- androidETC2FallbackOverride: 0
- - buildTarget: Standalone
- maxTextureSize: 2048
- resizeAlgorithm: 0
- textureFormat: -1
- textureCompression: 0
- compressionQuality: 50
- crunchedCompression: 0
- allowsAlphaSplitting: 0
- overridden: 0
- androidETC2FallbackOverride: 0
+ buildTargetSettings: []
spriteSheet:
- serializedVersion: 2
sprites: []
outline: []
- physicsShape: []
spritePackingTag:
userData:
assetBundleName:
diff --git a/Gizmos/ButtonSphere.png.meta b/Gizmos/ButtonSphere.png.meta
index ca65a3f2..bd84eeda 100644
--- a/Gizmos/ButtonSphere.png.meta
+++ b/Gizmos/ButtonSphere.png.meta
@@ -29,7 +29,7 @@ TextureImporter:
textureFormat: -3
maxTextureSize: 2048
textureSettings:
- filterMode: -1
+ filterMode: 1
aniso: 1
mipBias: -1
wrapMode: 1
@@ -46,7 +46,6 @@ TextureImporter:
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spritePixelsToUnits: 100
alphaIsTransparency: 1
- spriteTessellationDetail: -1
textureType: 2
buildTargetSettings: []
spriteSheet:
diff --git a/Gizmos/ButtonStairs.png.meta b/Gizmos/ButtonStairs.png.meta
index 1f92e1f4..039d866d 100644
--- a/Gizmos/ButtonStairs.png.meta
+++ b/Gizmos/ButtonStairs.png.meta
@@ -29,7 +29,7 @@ TextureImporter:
textureFormat: -3
maxTextureSize: 2048
textureSettings:
- filterMode: -1
+ filterMode: 1
aniso: 1
mipBias: -1
wrapMode: 1
@@ -46,7 +46,6 @@ TextureImporter:
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spritePixelsToUnits: 100
alphaIsTransparency: 1
- spriteTessellationDetail: -1
textureType: 2
buildTargetSettings: []
spriteSheet:
diff --git a/Gizmos/Group.png b/Gizmos/Group.png
new file mode 100644
index 00000000..b9362a22
Binary files /dev/null and b/Gizmos/Group.png differ
diff --git a/Gizmos/Group.png.meta b/Gizmos/Group.png.meta
new file mode 100644
index 00000000..24fcda58
--- /dev/null
+++ b/Gizmos/Group.png.meta
@@ -0,0 +1,87 @@
+fileFormatVersion: 2
+guid: d3111939d820a4f45bd920faf050f29a
+timeCreated: 1521296720
+licenseType: Free
+TextureImporter:
+ fileIDToRecycleName: {}
+ externalObjects: {}
+ serializedVersion: 4
+ mipmaps:
+ mipMapMode: 0
+ enableMipMap: 0
+ sRGBTexture: 0
+ linearTexture: 0
+ fadeOut: 0
+ borderMipMap: 0
+ mipMapsPreserveCoverage: 0
+ alphaTestReferenceValue: 0.5
+ mipMapFadeDistanceStart: 1
+ mipMapFadeDistanceEnd: 3
+ bumpmap:
+ convertToNormalMap: 0
+ externalNormalMap: 0
+ heightScale: 0.25
+ normalMapFilter: 0
+ isReadable: 0
+ grayScaleToAlpha: 0
+ generateCubemap: 6
+ cubemapConvolution: 0
+ seamlessCubemap: 0
+ textureFormat: 1
+ maxTextureSize: 2048
+ textureSettings:
+ serializedVersion: 2
+ filterMode: 0
+ aniso: 1
+ mipBias: -1
+ wrapU: 1
+ wrapV: 1
+ wrapW: -1
+ nPOTScale: 0
+ lightmap: 0
+ compressionQuality: 50
+ spriteMode: 0
+ spriteExtrude: 1
+ spriteMeshType: 1
+ alignment: 0
+ spritePivot: {x: 0.5, y: 0.5}
+ spriteBorder: {x: 0, y: 0, z: 0, w: 0}
+ spritePixelsToUnits: 100
+ alphaUsage: 1
+ alphaIsTransparency: 1
+ spriteTessellationDetail: -1
+ textureType: 2
+ textureShape: 1
+ maxTextureSizeSet: 0
+ compressionQualitySet: 0
+ textureFormatSet: 0
+ platformSettings:
+ - buildTarget: DefaultTexturePlatform
+ maxTextureSize: 2048
+ resizeAlgorithm: 0
+ textureFormat: -1
+ textureCompression: 0
+ compressionQuality: 50
+ crunchedCompression: 0
+ allowsAlphaSplitting: 0
+ overridden: 0
+ androidETC2FallbackOverride: 0
+ - buildTarget: Standalone
+ maxTextureSize: 2048
+ resizeAlgorithm: 0
+ textureFormat: -1
+ textureCompression: 0
+ compressionQuality: 50
+ crunchedCompression: 0
+ allowsAlphaSplitting: 0
+ overridden: 0
+ androidETC2FallbackOverride: 0
+ spriteSheet:
+ serializedVersion: 2
+ sprites: []
+ outline: []
+ physicsShape: []
+ spritePackingTag:
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Gizmos/ImporterBackground.png b/Gizmos/ImporterBackground.png
new file mode 100644
index 00000000..c1c721bc
Binary files /dev/null and b/Gizmos/ImporterBackground.png differ
diff --git a/Gizmos/ImporterBackground.png.meta b/Gizmos/ImporterBackground.png.meta
new file mode 100644
index 00000000..ff384295
--- /dev/null
+++ b/Gizmos/ImporterBackground.png.meta
@@ -0,0 +1,87 @@
+fileFormatVersion: 2
+guid: e8fe8099d37fdf742a13bb041e5b67a1
+timeCreated: 1526753113
+licenseType: Free
+TextureImporter:
+ fileIDToRecycleName: {}
+ externalObjects: {}
+ serializedVersion: 4
+ mipmaps:
+ mipMapMode: 0
+ enableMipMap: 0
+ sRGBTexture: 0
+ linearTexture: 0
+ fadeOut: 0
+ borderMipMap: 0
+ mipMapsPreserveCoverage: 0
+ alphaTestReferenceValue: 0.5
+ mipMapFadeDistanceStart: 1
+ mipMapFadeDistanceEnd: 3
+ bumpmap:
+ convertToNormalMap: 0
+ externalNormalMap: 0
+ heightScale: 0.25
+ normalMapFilter: 0
+ isReadable: 0
+ grayScaleToAlpha: 0
+ generateCubemap: 6
+ cubemapConvolution: 0
+ seamlessCubemap: 0
+ textureFormat: 1
+ maxTextureSize: 2048
+ textureSettings:
+ serializedVersion: 2
+ filterMode: -1
+ aniso: 1
+ mipBias: -1
+ wrapU: 1
+ wrapV: 1
+ wrapW: -1
+ nPOTScale: 0
+ lightmap: 0
+ compressionQuality: 50
+ spriteMode: 0
+ spriteExtrude: 1
+ spriteMeshType: 1
+ alignment: 0
+ spritePivot: {x: 0.5, y: 0.5}
+ spriteBorder: {x: 0, y: 0, z: 0, w: 0}
+ spritePixelsToUnits: 100
+ alphaUsage: 1
+ alphaIsTransparency: 1
+ spriteTessellationDetail: -1
+ textureType: 2
+ textureShape: 1
+ maxTextureSizeSet: 0
+ compressionQualitySet: 0
+ textureFormatSet: 0
+ platformSettings:
+ - buildTarget: DefaultTexturePlatform
+ maxTextureSize: 2048
+ resizeAlgorithm: 0
+ textureFormat: -1
+ textureCompression: 0
+ compressionQuality: 50
+ crunchedCompression: 0
+ allowsAlphaSplitting: 0
+ overridden: 0
+ androidETC2FallbackOverride: 0
+ - buildTarget: Standalone
+ maxTextureSize: 2048
+ resizeAlgorithm: 0
+ textureFormat: -1
+ textureCompression: 0
+ compressionQuality: 50
+ crunchedCompression: 0
+ allowsAlphaSplitting: 0
+ overridden: 0
+ androidETC2FallbackOverride: 0
+ spriteSheet:
+ serializedVersion: 2
+ sprites: []
+ outline: []
+ physicsShape: []
+ spritePackingTag:
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Gizmos/ImporterUnrealGold.png b/Gizmos/ImporterUnrealGold.png
new file mode 100644
index 00000000..36b7f967
Binary files /dev/null and b/Gizmos/ImporterUnrealGold.png differ
diff --git a/Gizmos/ImporterUnrealGold.png.meta b/Gizmos/ImporterUnrealGold.png.meta
new file mode 100644
index 00000000..f0c6be2c
--- /dev/null
+++ b/Gizmos/ImporterUnrealGold.png.meta
@@ -0,0 +1,87 @@
+fileFormatVersion: 2
+guid: 543dd96d3d3752d479482d09e478e7b0
+timeCreated: 1526752452
+licenseType: Free
+TextureImporter:
+ fileIDToRecycleName: {}
+ externalObjects: {}
+ serializedVersion: 4
+ mipmaps:
+ mipMapMode: 0
+ enableMipMap: 0
+ sRGBTexture: 0
+ linearTexture: 0
+ fadeOut: 0
+ borderMipMap: 0
+ mipMapsPreserveCoverage: 0
+ alphaTestReferenceValue: 0.5
+ mipMapFadeDistanceStart: 1
+ mipMapFadeDistanceEnd: 3
+ bumpmap:
+ convertToNormalMap: 0
+ externalNormalMap: 0
+ heightScale: 0.25
+ normalMapFilter: 0
+ isReadable: 0
+ grayScaleToAlpha: 0
+ generateCubemap: 6
+ cubemapConvolution: 0
+ seamlessCubemap: 0
+ textureFormat: 1
+ maxTextureSize: 2048
+ textureSettings:
+ serializedVersion: 2
+ filterMode: -1
+ aniso: 1
+ mipBias: -1
+ wrapU: 1
+ wrapV: 1
+ wrapW: -1
+ nPOTScale: 0
+ lightmap: 0
+ compressionQuality: 50
+ spriteMode: 0
+ spriteExtrude: 1
+ spriteMeshType: 1
+ alignment: 0
+ spritePivot: {x: 0.5, y: 0.5}
+ spriteBorder: {x: 0, y: 0, z: 0, w: 0}
+ spritePixelsToUnits: 100
+ alphaUsage: 1
+ alphaIsTransparency: 1
+ spriteTessellationDetail: -1
+ textureType: 2
+ textureShape: 1
+ maxTextureSizeSet: 0
+ compressionQualitySet: 0
+ textureFormatSet: 0
+ platformSettings:
+ - buildTarget: DefaultTexturePlatform
+ maxTextureSize: 2048
+ resizeAlgorithm: 0
+ textureFormat: -1
+ textureCompression: 0
+ compressionQuality: 50
+ crunchedCompression: 0
+ allowsAlphaSplitting: 0
+ overridden: 0
+ androidETC2FallbackOverride: 0
+ - buildTarget: Standalone
+ maxTextureSize: 2048
+ resizeAlgorithm: 0
+ textureFormat: -1
+ textureCompression: 0
+ compressionQuality: 50
+ crunchedCompression: 0
+ allowsAlphaSplitting: 0
+ overridden: 0
+ androidETC2FallbackOverride: 0
+ spriteSheet:
+ serializedVersion: 2
+ sprites: []
+ outline: []
+ physicsShape: []
+ spritePackingTag:
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Gizmos/ImporterValveMapFormat2006.png b/Gizmos/ImporterValveMapFormat2006.png
new file mode 100644
index 00000000..5f8ff2ae
Binary files /dev/null and b/Gizmos/ImporterValveMapFormat2006.png differ
diff --git a/Gizmos/ImporterValveMapFormat2006.png.meta b/Gizmos/ImporterValveMapFormat2006.png.meta
new file mode 100644
index 00000000..5815773b
--- /dev/null
+++ b/Gizmos/ImporterValveMapFormat2006.png.meta
@@ -0,0 +1,87 @@
+fileFormatVersion: 2
+guid: 0c70bdc34f6ab3646b63c29de2c3f0bb
+timeCreated: 1526754071
+licenseType: Free
+TextureImporter:
+ fileIDToRecycleName: {}
+ externalObjects: {}
+ serializedVersion: 4
+ mipmaps:
+ mipMapMode: 0
+ enableMipMap: 0
+ sRGBTexture: 0
+ linearTexture: 0
+ fadeOut: 0
+ borderMipMap: 0
+ mipMapsPreserveCoverage: 0
+ alphaTestReferenceValue: 0.5
+ mipMapFadeDistanceStart: 1
+ mipMapFadeDistanceEnd: 3
+ bumpmap:
+ convertToNormalMap: 0
+ externalNormalMap: 0
+ heightScale: 0.25
+ normalMapFilter: 0
+ isReadable: 0
+ grayScaleToAlpha: 0
+ generateCubemap: 6
+ cubemapConvolution: 0
+ seamlessCubemap: 0
+ textureFormat: 1
+ maxTextureSize: 2048
+ textureSettings:
+ serializedVersion: 2
+ filterMode: -1
+ aniso: 1
+ mipBias: -1
+ wrapU: 1
+ wrapV: 1
+ wrapW: -1
+ nPOTScale: 0
+ lightmap: 0
+ compressionQuality: 50
+ spriteMode: 0
+ spriteExtrude: 1
+ spriteMeshType: 1
+ alignment: 0
+ spritePivot: {x: 0.5, y: 0.5}
+ spriteBorder: {x: 0, y: 0, z: 0, w: 0}
+ spritePixelsToUnits: 100
+ alphaUsage: 1
+ alphaIsTransparency: 1
+ spriteTessellationDetail: -1
+ textureType: 2
+ textureShape: 1
+ maxTextureSizeSet: 0
+ compressionQualitySet: 0
+ textureFormatSet: 0
+ platformSettings:
+ - buildTarget: DefaultTexturePlatform
+ maxTextureSize: 2048
+ resizeAlgorithm: 0
+ textureFormat: -1
+ textureCompression: 0
+ compressionQuality: 50
+ crunchedCompression: 0
+ allowsAlphaSplitting: 0
+ overridden: 0
+ androidETC2FallbackOverride: 0
+ - buildTarget: Standalone
+ maxTextureSize: 2048
+ resizeAlgorithm: 0
+ textureFormat: -1
+ textureCompression: 0
+ compressionQuality: 50
+ crunchedCompression: 0
+ allowsAlphaSplitting: 0
+ overridden: 0
+ androidETC2FallbackOverride: 0
+ spriteSheet:
+ serializedVersion: 2
+ sprites: []
+ outline: []
+ physicsShape: []
+ spritePackingTag:
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Gizmos/NoCSG.png.meta b/Gizmos/NoCSG.png.meta
index f1cb888e..5267b648 100644
--- a/Gizmos/NoCSG.png.meta
+++ b/Gizmos/NoCSG.png.meta
@@ -29,7 +29,7 @@ TextureImporter:
textureFormat: -3
maxTextureSize: 2048
textureSettings:
- filterMode: 0
+ filterMode: 1
aniso: 1
mipBias: -1
wrapMode: 1
@@ -46,7 +46,6 @@ TextureImporter:
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spritePixelsToUnits: 100
alphaIsTransparency: 1
- spriteTessellationDetail: -1
textureType: 2
buildTargetSettings: []
spriteSheet:
diff --git a/Gizmos/ShapeEditorCreatePolygon.png.meta b/Gizmos/ShapeEditorCreatePolygon.png.meta
index e092e4cd..35875492 100644
--- a/Gizmos/ShapeEditorCreatePolygon.png.meta
+++ b/Gizmos/ShapeEditorCreatePolygon.png.meta
@@ -4,17 +4,14 @@ timeCreated: 1518385415
licenseType: Free
TextureImporter:
fileIDToRecycleName: {}
- externalObjects: {}
- serializedVersion: 4
+ serializedVersion: 2
mipmaps:
mipMapMode: 0
enableMipMap: 0
- sRGBTexture: 0
- linearTexture: 0
+ linearTexture: 1
+ correctGamma: 0
fadeOut: 0
borderMipMap: 0
- mipMapsPreserveCoverage: 0
- alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
@@ -24,22 +21,23 @@ TextureImporter:
normalMapFilter: 0
isReadable: 0
grayScaleToAlpha: 0
- generateCubemap: 6
+ generateCubemap: 0
cubemapConvolution: 0
+ cubemapConvolutionSteps: 7
+ cubemapConvolutionExponent: 1.5
seamlessCubemap: 0
- textureFormat: 1
+ textureFormat: -3
maxTextureSize: 2048
textureSettings:
- serializedVersion: 2
- filterMode: -1
+ filterMode: 1
aniso: 1
mipBias: -1
- wrapU: 1
- wrapV: 1
- wrapW: -1
+ wrapMode: 1
nPOTScale: 0
lightmap: 0
+ rGBM: 0
compressionQuality: 50
+ allowsAlphaSplitting: 0
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
@@ -47,40 +45,12 @@ TextureImporter:
spritePivot: {x: 0.5, y: 0.5}
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spritePixelsToUnits: 100
- alphaUsage: 1
alphaIsTransparency: 1
- spriteTessellationDetail: -1
textureType: 2
- textureShape: 1
- maxTextureSizeSet: 0
- compressionQualitySet: 0
- textureFormatSet: 0
- platformSettings:
- - buildTarget: DefaultTexturePlatform
- maxTextureSize: 2048
- resizeAlgorithm: 0
- textureFormat: -1
- textureCompression: 0
- compressionQuality: 50
- crunchedCompression: 0
- allowsAlphaSplitting: 0
- overridden: 0
- androidETC2FallbackOverride: 0
- - buildTarget: Standalone
- maxTextureSize: 2048
- resizeAlgorithm: 0
- textureFormat: -1
- textureCompression: 0
- compressionQuality: 50
- crunchedCompression: 0
- allowsAlphaSplitting: 0
- overridden: 0
- androidETC2FallbackOverride: 0
+ buildTargetSettings: []
spriteSheet:
- serializedVersion: 2
sprites: []
outline: []
- physicsShape: []
spritePackingTag:
userData:
assetBundleName:
diff --git a/Gizmos/ShapeEditorDelete.png.meta b/Gizmos/ShapeEditorDelete.png.meta
index 9aa875f3..fff386b6 100644
--- a/Gizmos/ShapeEditorDelete.png.meta
+++ b/Gizmos/ShapeEditorDelete.png.meta
@@ -4,17 +4,14 @@ timeCreated: 1518386878
licenseType: Free
TextureImporter:
fileIDToRecycleName: {}
- externalObjects: {}
- serializedVersion: 4
+ serializedVersion: 2
mipmaps:
mipMapMode: 0
enableMipMap: 0
- sRGBTexture: 0
- linearTexture: 0
+ linearTexture: 1
+ correctGamma: 0
fadeOut: 0
borderMipMap: 0
- mipMapsPreserveCoverage: 0
- alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
@@ -24,22 +21,23 @@ TextureImporter:
normalMapFilter: 0
isReadable: 0
grayScaleToAlpha: 0
- generateCubemap: 6
+ generateCubemap: 0
cubemapConvolution: 0
+ cubemapConvolutionSteps: 7
+ cubemapConvolutionExponent: 1.5
seamlessCubemap: 0
- textureFormat: 1
+ textureFormat: -3
maxTextureSize: 2048
textureSettings:
- serializedVersion: 2
- filterMode: -1
+ filterMode: 1
aniso: 1
mipBias: -1
- wrapU: 1
- wrapV: 1
- wrapW: -1
+ wrapMode: 1
nPOTScale: 0
lightmap: 0
+ rGBM: 0
compressionQuality: 50
+ allowsAlphaSplitting: 0
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
@@ -47,40 +45,12 @@ TextureImporter:
spritePivot: {x: 0.5, y: 0.5}
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spritePixelsToUnits: 100
- alphaUsage: 1
alphaIsTransparency: 1
- spriteTessellationDetail: -1
textureType: 2
- textureShape: 1
- maxTextureSizeSet: 0
- compressionQualitySet: 0
- textureFormatSet: 0
- platformSettings:
- - buildTarget: DefaultTexturePlatform
- maxTextureSize: 2048
- resizeAlgorithm: 0
- textureFormat: -1
- textureCompression: 0
- compressionQuality: 50
- crunchedCompression: 0
- allowsAlphaSplitting: 0
- overridden: 0
- androidETC2FallbackOverride: 0
- - buildTarget: Standalone
- maxTextureSize: 2048
- resizeAlgorithm: 0
- textureFormat: -1
- textureCompression: 0
- compressionQuality: 50
- crunchedCompression: 0
- allowsAlphaSplitting: 0
- overridden: 0
- androidETC2FallbackOverride: 0
+ buildTargetSettings: []
spriteSheet:
- serializedVersion: 2
sprites: []
outline: []
- physicsShape: []
spritePackingTag:
userData:
assetBundleName:
diff --git a/Gizmos/ShapeEditorExtrudeBevel.png.meta b/Gizmos/ShapeEditorExtrudeBevel.png.meta
index 3c8ae7a1..c1cd508f 100644
--- a/Gizmos/ShapeEditorExtrudeBevel.png.meta
+++ b/Gizmos/ShapeEditorExtrudeBevel.png.meta
@@ -4,17 +4,14 @@ timeCreated: 1518385415
licenseType: Free
TextureImporter:
fileIDToRecycleName: {}
- externalObjects: {}
- serializedVersion: 4
+ serializedVersion: 2
mipmaps:
mipMapMode: 0
enableMipMap: 0
- sRGBTexture: 0
- linearTexture: 0
+ linearTexture: 1
+ correctGamma: 0
fadeOut: 0
borderMipMap: 0
- mipMapsPreserveCoverage: 0
- alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
@@ -24,22 +21,23 @@ TextureImporter:
normalMapFilter: 0
isReadable: 0
grayScaleToAlpha: 0
- generateCubemap: 6
+ generateCubemap: 0
cubemapConvolution: 0
+ cubemapConvolutionSteps: 7
+ cubemapConvolutionExponent: 1.5
seamlessCubemap: 0
- textureFormat: 1
+ textureFormat: -3
maxTextureSize: 2048
textureSettings:
- serializedVersion: 2
- filterMode: -1
+ filterMode: 1
aniso: 1
mipBias: -1
- wrapU: 1
- wrapV: 1
- wrapW: -1
+ wrapMode: 1
nPOTScale: 0
lightmap: 0
+ rGBM: 0
compressionQuality: 50
+ allowsAlphaSplitting: 0
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
@@ -47,40 +45,12 @@ TextureImporter:
spritePivot: {x: 0.5, y: 0.5}
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spritePixelsToUnits: 100
- alphaUsage: 1
alphaIsTransparency: 1
- spriteTessellationDetail: -1
textureType: 2
- textureShape: 1
- maxTextureSizeSet: 0
- compressionQualitySet: 0
- textureFormatSet: 0
- platformSettings:
- - buildTarget: DefaultTexturePlatform
- maxTextureSize: 2048
- resizeAlgorithm: 0
- textureFormat: -1
- textureCompression: 0
- compressionQuality: 50
- crunchedCompression: 0
- allowsAlphaSplitting: 0
- overridden: 0
- androidETC2FallbackOverride: 0
- - buildTarget: Standalone
- maxTextureSize: 2048
- resizeAlgorithm: 0
- textureFormat: -1
- textureCompression: 0
- compressionQuality: 50
- crunchedCompression: 0
- allowsAlphaSplitting: 0
- overridden: 0
- androidETC2FallbackOverride: 0
+ buildTargetSettings: []
spriteSheet:
- serializedVersion: 2
sprites: []
outline: []
- physicsShape: []
spritePackingTag:
userData:
assetBundleName:
diff --git a/Gizmos/ShapeEditorExtrudePoint.png.meta b/Gizmos/ShapeEditorExtrudePoint.png.meta
index b3dc5c50..10a9c032 100644
--- a/Gizmos/ShapeEditorExtrudePoint.png.meta
+++ b/Gizmos/ShapeEditorExtrudePoint.png.meta
@@ -4,17 +4,14 @@ timeCreated: 1518385415
licenseType: Free
TextureImporter:
fileIDToRecycleName: {}
- externalObjects: {}
- serializedVersion: 4
+ serializedVersion: 2
mipmaps:
mipMapMode: 0
enableMipMap: 0
- sRGBTexture: 0
- linearTexture: 0
+ linearTexture: 1
+ correctGamma: 0
fadeOut: 0
borderMipMap: 0
- mipMapsPreserveCoverage: 0
- alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
@@ -24,22 +21,23 @@ TextureImporter:
normalMapFilter: 0
isReadable: 0
grayScaleToAlpha: 0
- generateCubemap: 6
+ generateCubemap: 0
cubemapConvolution: 0
+ cubemapConvolutionSteps: 7
+ cubemapConvolutionExponent: 1.5
seamlessCubemap: 0
- textureFormat: 1
+ textureFormat: -3
maxTextureSize: 2048
textureSettings:
- serializedVersion: 2
- filterMode: -1
+ filterMode: 1
aniso: 1
mipBias: -1
- wrapU: 1
- wrapV: 1
- wrapW: -1
+ wrapMode: 1
nPOTScale: 0
lightmap: 0
+ rGBM: 0
compressionQuality: 50
+ allowsAlphaSplitting: 0
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
@@ -47,40 +45,12 @@ TextureImporter:
spritePivot: {x: 0.5, y: 0.5}
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spritePixelsToUnits: 100
- alphaUsage: 1
alphaIsTransparency: 1
- spriteTessellationDetail: -1
textureType: 2
- textureShape: 1
- maxTextureSizeSet: 0
- compressionQualitySet: 0
- textureFormatSet: 0
- platformSettings:
- - buildTarget: DefaultTexturePlatform
- maxTextureSize: 2048
- resizeAlgorithm: 0
- textureFormat: -1
- textureCompression: 0
- compressionQuality: 50
- crunchedCompression: 0
- allowsAlphaSplitting: 0
- overridden: 0
- androidETC2FallbackOverride: 0
- - buildTarget: Standalone
- maxTextureSize: 2048
- resizeAlgorithm: 0
- textureFormat: -1
- textureCompression: 0
- compressionQuality: 50
- crunchedCompression: 0
- allowsAlphaSplitting: 0
- overridden: 0
- androidETC2FallbackOverride: 0
+ buildTargetSettings: []
spriteSheet:
- serializedVersion: 2
sprites: []
outline: []
- physicsShape: []
spritePackingTag:
userData:
assetBundleName:
diff --git a/Gizmos/ShapeEditorExtrudeRevolve.png.meta b/Gizmos/ShapeEditorExtrudeRevolve.png.meta
index d71d4b29..40a4f21b 100644
--- a/Gizmos/ShapeEditorExtrudeRevolve.png.meta
+++ b/Gizmos/ShapeEditorExtrudeRevolve.png.meta
@@ -4,17 +4,14 @@ timeCreated: 1518385415
licenseType: Free
TextureImporter:
fileIDToRecycleName: {}
- externalObjects: {}
- serializedVersion: 4
+ serializedVersion: 2
mipmaps:
mipMapMode: 0
enableMipMap: 0
- sRGBTexture: 0
- linearTexture: 0
+ linearTexture: 1
+ correctGamma: 0
fadeOut: 0
borderMipMap: 0
- mipMapsPreserveCoverage: 0
- alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
@@ -24,22 +21,23 @@ TextureImporter:
normalMapFilter: 0
isReadable: 0
grayScaleToAlpha: 0
- generateCubemap: 6
+ generateCubemap: 0
cubemapConvolution: 0
+ cubemapConvolutionSteps: 7
+ cubemapConvolutionExponent: 1.5
seamlessCubemap: 0
- textureFormat: 1
+ textureFormat: -3
maxTextureSize: 2048
textureSettings:
- serializedVersion: 2
- filterMode: -1
+ filterMode: 1
aniso: 1
mipBias: -1
- wrapU: 1
- wrapV: 1
- wrapW: -1
+ wrapMode: 1
nPOTScale: 0
lightmap: 0
+ rGBM: 0
compressionQuality: 50
+ allowsAlphaSplitting: 0
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
@@ -47,40 +45,12 @@ TextureImporter:
spritePivot: {x: 0.5, y: 0.5}
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spritePixelsToUnits: 100
- alphaUsage: 1
alphaIsTransparency: 1
- spriteTessellationDetail: -1
textureType: 2
- textureShape: 1
- maxTextureSizeSet: 0
- compressionQualitySet: 0
- textureFormatSet: 0
- platformSettings:
- - buildTarget: DefaultTexturePlatform
- maxTextureSize: 2048
- resizeAlgorithm: 0
- textureFormat: -1
- textureCompression: 0
- compressionQuality: 50
- crunchedCompression: 0
- allowsAlphaSplitting: 0
- overridden: 0
- androidETC2FallbackOverride: 0
- - buildTarget: Standalone
- maxTextureSize: 2048
- resizeAlgorithm: 0
- textureFormat: -1
- textureCompression: 0
- compressionQuality: 50
- crunchedCompression: 0
- allowsAlphaSplitting: 0
- overridden: 0
- androidETC2FallbackOverride: 0
+ buildTargetSettings: []
spriteSheet:
- serializedVersion: 2
sprites: []
outline: []
- physicsShape: []
spritePackingTag:
userData:
assetBundleName:
diff --git a/Gizmos/ShapeEditorExtrudeShape.png.meta b/Gizmos/ShapeEditorExtrudeShape.png.meta
index 5b92fc97..59057101 100644
--- a/Gizmos/ShapeEditorExtrudeShape.png.meta
+++ b/Gizmos/ShapeEditorExtrudeShape.png.meta
@@ -4,17 +4,14 @@ timeCreated: 1518385415
licenseType: Free
TextureImporter:
fileIDToRecycleName: {}
- externalObjects: {}
- serializedVersion: 4
+ serializedVersion: 2
mipmaps:
mipMapMode: 0
enableMipMap: 0
- sRGBTexture: 0
- linearTexture: 0
+ linearTexture: 1
+ correctGamma: 0
fadeOut: 0
borderMipMap: 0
- mipMapsPreserveCoverage: 0
- alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
@@ -24,22 +21,23 @@ TextureImporter:
normalMapFilter: 0
isReadable: 0
grayScaleToAlpha: 0
- generateCubemap: 6
+ generateCubemap: 0
cubemapConvolution: 0
+ cubemapConvolutionSteps: 7
+ cubemapConvolutionExponent: 1.5
seamlessCubemap: 0
- textureFormat: 1
+ textureFormat: -3
maxTextureSize: 2048
textureSettings:
- serializedVersion: 2
- filterMode: -1
+ filterMode: 1
aniso: 1
mipBias: -1
- wrapU: 1
- wrapV: 1
- wrapW: -1
+ wrapMode: 1
nPOTScale: 0
lightmap: 0
+ rGBM: 0
compressionQuality: 50
+ allowsAlphaSplitting: 0
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
@@ -47,40 +45,12 @@ TextureImporter:
spritePivot: {x: 0.5, y: 0.5}
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spritePixelsToUnits: 100
- alphaUsage: 1
alphaIsTransparency: 1
- spriteTessellationDetail: -1
textureType: 2
- textureShape: 1
- maxTextureSizeSet: 0
- compressionQualitySet: 0
- textureFormatSet: 0
- platformSettings:
- - buildTarget: DefaultTexturePlatform
- maxTextureSize: 2048
- resizeAlgorithm: 0
- textureFormat: -1
- textureCompression: 0
- compressionQuality: 50
- crunchedCompression: 0
- allowsAlphaSplitting: 0
- overridden: 0
- androidETC2FallbackOverride: 0
- - buildTarget: Standalone
- maxTextureSize: 2048
- resizeAlgorithm: 0
- textureFormat: -1
- textureCompression: 0
- compressionQuality: 50
- crunchedCompression: 0
- allowsAlphaSplitting: 0
- overridden: 0
- androidETC2FallbackOverride: 0
+ buildTargetSettings: []
spriteSheet:
- serializedVersion: 2
sprites: []
outline: []
- physicsShape: []
spritePackingTag:
userData:
assetBundleName:
diff --git a/Gizmos/ShapeEditorFlipHorizontally.png.meta b/Gizmos/ShapeEditorFlipHorizontally.png.meta
index a47762b6..0019f03b 100644
--- a/Gizmos/ShapeEditorFlipHorizontally.png.meta
+++ b/Gizmos/ShapeEditorFlipHorizontally.png.meta
@@ -4,17 +4,14 @@ timeCreated: 1518386878
licenseType: Free
TextureImporter:
fileIDToRecycleName: {}
- externalObjects: {}
- serializedVersion: 4
+ serializedVersion: 2
mipmaps:
mipMapMode: 0
enableMipMap: 0
- sRGBTexture: 0
- linearTexture: 0
+ linearTexture: 1
+ correctGamma: 0
fadeOut: 0
borderMipMap: 0
- mipMapsPreserveCoverage: 0
- alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
@@ -24,22 +21,23 @@ TextureImporter:
normalMapFilter: 0
isReadable: 0
grayScaleToAlpha: 0
- generateCubemap: 6
+ generateCubemap: 0
cubemapConvolution: 0
+ cubemapConvolutionSteps: 7
+ cubemapConvolutionExponent: 1.5
seamlessCubemap: 0
- textureFormat: 1
+ textureFormat: -3
maxTextureSize: 2048
textureSettings:
- serializedVersion: 2
- filterMode: -1
+ filterMode: 1
aniso: 1
mipBias: -1
- wrapU: 1
- wrapV: 1
- wrapW: -1
+ wrapMode: 1
nPOTScale: 0
lightmap: 0
+ rGBM: 0
compressionQuality: 50
+ allowsAlphaSplitting: 0
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
@@ -47,40 +45,12 @@ TextureImporter:
spritePivot: {x: 0.5, y: 0.5}
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spritePixelsToUnits: 100
- alphaUsage: 1
alphaIsTransparency: 1
- spriteTessellationDetail: -1
textureType: 2
- textureShape: 1
- maxTextureSizeSet: 0
- compressionQualitySet: 0
- textureFormatSet: 0
- platformSettings:
- - buildTarget: DefaultTexturePlatform
- maxTextureSize: 2048
- resizeAlgorithm: 0
- textureFormat: -1
- textureCompression: 0
- compressionQuality: 50
- crunchedCompression: 0
- allowsAlphaSplitting: 0
- overridden: 0
- androidETC2FallbackOverride: 0
- - buildTarget: Standalone
- maxTextureSize: 2048
- resizeAlgorithm: 0
- textureFormat: -1
- textureCompression: 0
- compressionQuality: 50
- crunchedCompression: 0
- allowsAlphaSplitting: 0
- overridden: 0
- androidETC2FallbackOverride: 0
+ buildTargetSettings: []
spriteSheet:
- serializedVersion: 2
sprites: []
outline: []
- physicsShape: []
spritePackingTag:
userData:
assetBundleName:
diff --git a/Gizmos/ShapeEditorFlipVertically.png.meta b/Gizmos/ShapeEditorFlipVertically.png.meta
index 5528fb0c..08033781 100644
--- a/Gizmos/ShapeEditorFlipVertically.png.meta
+++ b/Gizmos/ShapeEditorFlipVertically.png.meta
@@ -4,17 +4,14 @@ timeCreated: 1518386878
licenseType: Free
TextureImporter:
fileIDToRecycleName: {}
- externalObjects: {}
- serializedVersion: 4
+ serializedVersion: 2
mipmaps:
mipMapMode: 0
enableMipMap: 0
- sRGBTexture: 0
- linearTexture: 0
+ linearTexture: 1
+ correctGamma: 0
fadeOut: 0
borderMipMap: 0
- mipMapsPreserveCoverage: 0
- alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
@@ -24,22 +21,23 @@ TextureImporter:
normalMapFilter: 0
isReadable: 0
grayScaleToAlpha: 0
- generateCubemap: 6
+ generateCubemap: 0
cubemapConvolution: 0
+ cubemapConvolutionSteps: 7
+ cubemapConvolutionExponent: 1.5
seamlessCubemap: 0
- textureFormat: 1
+ textureFormat: -3
maxTextureSize: 2048
textureSettings:
- serializedVersion: 2
- filterMode: -1
+ filterMode: 1
aniso: 1
mipBias: -1
- wrapU: 1
- wrapV: 1
- wrapW: -1
+ wrapMode: 1
nPOTScale: 0
lightmap: 0
+ rGBM: 0
compressionQuality: 50
+ allowsAlphaSplitting: 0
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
@@ -47,40 +45,12 @@ TextureImporter:
spritePivot: {x: 0.5, y: 0.5}
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spritePixelsToUnits: 100
- alphaUsage: 1
alphaIsTransparency: 1
- spriteTessellationDetail: -1
textureType: 2
- textureShape: 1
- maxTextureSizeSet: 0
- compressionQualitySet: 0
- textureFormatSet: 0
- platformSettings:
- - buildTarget: DefaultTexturePlatform
- maxTextureSize: 2048
- resizeAlgorithm: 0
- textureFormat: -1
- textureCompression: 0
- compressionQuality: 50
- crunchedCompression: 0
- allowsAlphaSplitting: 0
- overridden: 0
- androidETC2FallbackOverride: 0
- - buildTarget: Standalone
- maxTextureSize: 2048
- resizeAlgorithm: 0
- textureFormat: -1
- textureCompression: 0
- compressionQuality: 50
- crunchedCompression: 0
- allowsAlphaSplitting: 0
- overridden: 0
- androidETC2FallbackOverride: 0
+ buildTargetSettings: []
spriteSheet:
- serializedVersion: 2
sprites: []
outline: []
- physicsShape: []
spritePackingTag:
userData:
assetBundleName:
diff --git a/Gizmos/ShapeEditorHome.png.meta b/Gizmos/ShapeEditorHome.png.meta
index 7222a4ce..9f89d645 100644
--- a/Gizmos/ShapeEditorHome.png.meta
+++ b/Gizmos/ShapeEditorHome.png.meta
@@ -4,17 +4,14 @@ timeCreated: 1518723652
licenseType: Free
TextureImporter:
fileIDToRecycleName: {}
- externalObjects: {}
- serializedVersion: 4
+ serializedVersion: 2
mipmaps:
mipMapMode: 0
enableMipMap: 0
- sRGBTexture: 0
- linearTexture: 0
+ linearTexture: 1
+ correctGamma: 0
fadeOut: 0
borderMipMap: 0
- mipMapsPreserveCoverage: 0
- alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
@@ -24,22 +21,23 @@ TextureImporter:
normalMapFilter: 0
isReadable: 0
grayScaleToAlpha: 0
- generateCubemap: 6
+ generateCubemap: 0
cubemapConvolution: 0
+ cubemapConvolutionSteps: 7
+ cubemapConvolutionExponent: 1.5
seamlessCubemap: 0
- textureFormat: 1
+ textureFormat: -3
maxTextureSize: 2048
textureSettings:
- serializedVersion: 2
- filterMode: -1
+ filterMode: 1
aniso: 1
mipBias: -1
- wrapU: 1
- wrapV: 1
- wrapW: -1
+ wrapMode: 1
nPOTScale: 0
lightmap: 0
+ rGBM: 0
compressionQuality: 50
+ allowsAlphaSplitting: 0
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
@@ -47,40 +45,12 @@ TextureImporter:
spritePivot: {x: 0.5, y: 0.5}
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spritePixelsToUnits: 100
- alphaUsage: 1
alphaIsTransparency: 1
- spriteTessellationDetail: -1
textureType: 2
- textureShape: 1
- maxTextureSizeSet: 0
- compressionQualitySet: 0
- textureFormatSet: 0
- platformSettings:
- - buildTarget: DefaultTexturePlatform
- maxTextureSize: 2048
- resizeAlgorithm: 0
- textureFormat: -1
- textureCompression: 0
- compressionQuality: 50
- crunchedCompression: 0
- allowsAlphaSplitting: 0
- overridden: 0
- androidETC2FallbackOverride: 0
- - buildTarget: Standalone
- maxTextureSize: 2048
- resizeAlgorithm: 0
- textureFormat: -1
- textureCompression: 0
- compressionQuality: 50
- crunchedCompression: 0
- allowsAlphaSplitting: 0
- overridden: 0
- androidETC2FallbackOverride: 0
+ buildTargetSettings: []
spriteSheet:
- serializedVersion: 2
sprites: []
outline: []
- physicsShape: []
spritePackingTag:
userData:
assetBundleName:
diff --git a/Gizmos/ShapeEditorNew.png.meta b/Gizmos/ShapeEditorNew.png.meta
index 117d8e82..79fd6e60 100644
--- a/Gizmos/ShapeEditorNew.png.meta
+++ b/Gizmos/ShapeEditorNew.png.meta
@@ -4,17 +4,14 @@ timeCreated: 1518386878
licenseType: Free
TextureImporter:
fileIDToRecycleName: {}
- externalObjects: {}
- serializedVersion: 4
+ serializedVersion: 2
mipmaps:
mipMapMode: 0
enableMipMap: 0
- sRGBTexture: 0
- linearTexture: 0
+ linearTexture: 1
+ correctGamma: 0
fadeOut: 0
borderMipMap: 0
- mipMapsPreserveCoverage: 0
- alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
@@ -24,22 +21,23 @@ TextureImporter:
normalMapFilter: 0
isReadable: 0
grayScaleToAlpha: 0
- generateCubemap: 6
+ generateCubemap: 0
cubemapConvolution: 0
+ cubemapConvolutionSteps: 7
+ cubemapConvolutionExponent: 1.5
seamlessCubemap: 0
- textureFormat: 1
+ textureFormat: -3
maxTextureSize: 2048
textureSettings:
- serializedVersion: 2
- filterMode: -1
+ filterMode: 1
aniso: 1
mipBias: -1
- wrapU: 1
- wrapV: 1
- wrapW: -1
+ wrapMode: 1
nPOTScale: 0
lightmap: 0
+ rGBM: 0
compressionQuality: 50
+ allowsAlphaSplitting: 0
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
@@ -47,40 +45,12 @@ TextureImporter:
spritePivot: {x: 0.5, y: 0.5}
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spritePixelsToUnits: 100
- alphaUsage: 1
alphaIsTransparency: 1
- spriteTessellationDetail: -1
textureType: 2
- textureShape: 1
- maxTextureSizeSet: 0
- compressionQualitySet: 0
- textureFormatSet: 0
- platformSettings:
- - buildTarget: DefaultTexturePlatform
- maxTextureSize: 2048
- resizeAlgorithm: 0
- textureFormat: -1
- textureCompression: 0
- compressionQuality: 50
- crunchedCompression: 0
- allowsAlphaSplitting: 0
- overridden: 0
- androidETC2FallbackOverride: 0
- - buildTarget: Standalone
- maxTextureSize: 2048
- resizeAlgorithm: 0
- textureFormat: -1
- textureCompression: 0
- compressionQuality: 50
- crunchedCompression: 0
- allowsAlphaSplitting: 0
- overridden: 0
- androidETC2FallbackOverride: 0
+ buildTargetSettings: []
spriteSheet:
- serializedVersion: 2
sprites: []
outline: []
- physicsShape: []
spritePackingTag:
userData:
assetBundleName:
diff --git a/Gizmos/ShapeEditorOpen.png.meta b/Gizmos/ShapeEditorOpen.png.meta
index efd48cbb..497b9a4a 100644
--- a/Gizmos/ShapeEditorOpen.png.meta
+++ b/Gizmos/ShapeEditorOpen.png.meta
@@ -4,17 +4,14 @@ timeCreated: 1518386878
licenseType: Free
TextureImporter:
fileIDToRecycleName: {}
- externalObjects: {}
- serializedVersion: 4
+ serializedVersion: 2
mipmaps:
mipMapMode: 0
enableMipMap: 0
- sRGBTexture: 0
- linearTexture: 0
+ linearTexture: 1
+ correctGamma: 0
fadeOut: 0
borderMipMap: 0
- mipMapsPreserveCoverage: 0
- alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
@@ -24,22 +21,23 @@ TextureImporter:
normalMapFilter: 0
isReadable: 0
grayScaleToAlpha: 0
- generateCubemap: 6
+ generateCubemap: 0
cubemapConvolution: 0
+ cubemapConvolutionSteps: 7
+ cubemapConvolutionExponent: 1.5
seamlessCubemap: 0
- textureFormat: 1
+ textureFormat: -3
maxTextureSize: 2048
textureSettings:
- serializedVersion: 2
- filterMode: -1
+ filterMode: 1
aniso: 1
mipBias: -1
- wrapU: 1
- wrapV: 1
- wrapW: -1
+ wrapMode: 1
nPOTScale: 0
lightmap: 0
+ rGBM: 0
compressionQuality: 50
+ allowsAlphaSplitting: 0
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
@@ -47,40 +45,12 @@ TextureImporter:
spritePivot: {x: 0.5, y: 0.5}
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spritePixelsToUnits: 100
- alphaUsage: 1
alphaIsTransparency: 1
- spriteTessellationDetail: -1
textureType: 2
- textureShape: 1
- maxTextureSizeSet: 0
- compressionQualitySet: 0
- textureFormatSet: 0
- platformSettings:
- - buildTarget: DefaultTexturePlatform
- maxTextureSize: 2048
- resizeAlgorithm: 0
- textureFormat: -1
- textureCompression: 0
- compressionQuality: 50
- crunchedCompression: 0
- allowsAlphaSplitting: 0
- overridden: 0
- androidETC2FallbackOverride: 0
- - buildTarget: Standalone
- maxTextureSize: 2048
- resizeAlgorithm: 0
- textureFormat: -1
- textureCompression: 0
- compressionQuality: 50
- crunchedCompression: 0
- allowsAlphaSplitting: 0
- overridden: 0
- androidETC2FallbackOverride: 0
+ buildTargetSettings: []
spriteSheet:
- serializedVersion: 2
sprites: []
outline: []
- physicsShape: []
spritePackingTag:
userData:
assetBundleName:
diff --git a/Gizmos/ShapeEditorRotate90Left.png.meta b/Gizmos/ShapeEditorRotate90Left.png.meta
index 053012c0..9bf6d4eb 100644
--- a/Gizmos/ShapeEditorRotate90Left.png.meta
+++ b/Gizmos/ShapeEditorRotate90Left.png.meta
@@ -4,17 +4,14 @@ timeCreated: 1518440229
licenseType: Free
TextureImporter:
fileIDToRecycleName: {}
- externalObjects: {}
- serializedVersion: 4
+ serializedVersion: 2
mipmaps:
mipMapMode: 0
enableMipMap: 0
- sRGBTexture: 0
- linearTexture: 0
+ linearTexture: 1
+ correctGamma: 0
fadeOut: 0
borderMipMap: 0
- mipMapsPreserveCoverage: 0
- alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
@@ -24,22 +21,23 @@ TextureImporter:
normalMapFilter: 0
isReadable: 0
grayScaleToAlpha: 0
- generateCubemap: 6
+ generateCubemap: 0
cubemapConvolution: 0
+ cubemapConvolutionSteps: 7
+ cubemapConvolutionExponent: 1.5
seamlessCubemap: 0
- textureFormat: 1
+ textureFormat: -3
maxTextureSize: 2048
textureSettings:
- serializedVersion: 2
- filterMode: -1
+ filterMode: 1
aniso: 1
mipBias: -1
- wrapU: 1
- wrapV: 1
- wrapW: -1
+ wrapMode: 1
nPOTScale: 0
lightmap: 0
+ rGBM: 0
compressionQuality: 50
+ allowsAlphaSplitting: 0
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
@@ -47,40 +45,12 @@ TextureImporter:
spritePivot: {x: 0.5, y: 0.5}
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spritePixelsToUnits: 100
- alphaUsage: 1
alphaIsTransparency: 1
- spriteTessellationDetail: -1
textureType: 2
- textureShape: 1
- maxTextureSizeSet: 0
- compressionQualitySet: 0
- textureFormatSet: 0
- platformSettings:
- - buildTarget: DefaultTexturePlatform
- maxTextureSize: 2048
- resizeAlgorithm: 0
- textureFormat: -1
- textureCompression: 0
- compressionQuality: 50
- crunchedCompression: 0
- allowsAlphaSplitting: 0
- overridden: 0
- androidETC2FallbackOverride: 0
- - buildTarget: Standalone
- maxTextureSize: 2048
- resizeAlgorithm: 0
- textureFormat: -1
- textureCompression: 0
- compressionQuality: 50
- crunchedCompression: 0
- allowsAlphaSplitting: 0
- overridden: 0
- androidETC2FallbackOverride: 0
+ buildTargetSettings: []
spriteSheet:
- serializedVersion: 2
sprites: []
outline: []
- physicsShape: []
spritePackingTag:
userData:
assetBundleName:
diff --git a/Gizmos/ShapeEditorRotate90Right.png.meta b/Gizmos/ShapeEditorRotate90Right.png.meta
index 090b31df..39422916 100644
--- a/Gizmos/ShapeEditorRotate90Right.png.meta
+++ b/Gizmos/ShapeEditorRotate90Right.png.meta
@@ -4,17 +4,14 @@ timeCreated: 1518440229
licenseType: Free
TextureImporter:
fileIDToRecycleName: {}
- externalObjects: {}
- serializedVersion: 4
+ serializedVersion: 2
mipmaps:
mipMapMode: 0
enableMipMap: 0
- sRGBTexture: 0
- linearTexture: 0
+ linearTexture: 1
+ correctGamma: 0
fadeOut: 0
borderMipMap: 0
- mipMapsPreserveCoverage: 0
- alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
@@ -24,22 +21,23 @@ TextureImporter:
normalMapFilter: 0
isReadable: 0
grayScaleToAlpha: 0
- generateCubemap: 6
+ generateCubemap: 0
cubemapConvolution: 0
+ cubemapConvolutionSteps: 7
+ cubemapConvolutionExponent: 1.5
seamlessCubemap: 0
- textureFormat: 1
+ textureFormat: -3
maxTextureSize: 2048
textureSettings:
- serializedVersion: 2
- filterMode: -1
+ filterMode: 1
aniso: 1
mipBias: -1
- wrapU: 1
- wrapV: 1
- wrapW: -1
+ wrapMode: 1
nPOTScale: 0
lightmap: 0
+ rGBM: 0
compressionQuality: 50
+ allowsAlphaSplitting: 0
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
@@ -47,40 +45,12 @@ TextureImporter:
spritePivot: {x: 0.5, y: 0.5}
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spritePixelsToUnits: 100
- alphaUsage: 1
alphaIsTransparency: 1
- spriteTessellationDetail: -1
textureType: 2
- textureShape: 1
- maxTextureSizeSet: 0
- compressionQualitySet: 0
- textureFormatSet: 0
- platformSettings:
- - buildTarget: DefaultTexturePlatform
- maxTextureSize: 2048
- resizeAlgorithm: 0
- textureFormat: -1
- textureCompression: 0
- compressionQuality: 50
- crunchedCompression: 0
- allowsAlphaSplitting: 0
- overridden: 0
- androidETC2FallbackOverride: 0
- - buildTarget: Standalone
- maxTextureSize: 2048
- resizeAlgorithm: 0
- textureFormat: -1
- textureCompression: 0
- compressionQuality: 50
- crunchedCompression: 0
- allowsAlphaSplitting: 0
- overridden: 0
- androidETC2FallbackOverride: 0
+ buildTargetSettings: []
spriteSheet:
- serializedVersion: 2
sprites: []
outline: []
- physicsShape: []
spritePackingTag:
userData:
assetBundleName:
diff --git a/Gizmos/ShapeEditorSave.png.meta b/Gizmos/ShapeEditorSave.png.meta
index 71788a74..4e5d1c48 100644
--- a/Gizmos/ShapeEditorSave.png.meta
+++ b/Gizmos/ShapeEditorSave.png.meta
@@ -4,17 +4,14 @@ timeCreated: 1518386878
licenseType: Free
TextureImporter:
fileIDToRecycleName: {}
- externalObjects: {}
- serializedVersion: 4
+ serializedVersion: 2
mipmaps:
mipMapMode: 0
enableMipMap: 0
- sRGBTexture: 0
- linearTexture: 0
+ linearTexture: 1
+ correctGamma: 0
fadeOut: 0
borderMipMap: 0
- mipMapsPreserveCoverage: 0
- alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
@@ -24,22 +21,23 @@ TextureImporter:
normalMapFilter: 0
isReadable: 0
grayScaleToAlpha: 0
- generateCubemap: 6
+ generateCubemap: 0
cubemapConvolution: 0
+ cubemapConvolutionSteps: 7
+ cubemapConvolutionExponent: 1.5
seamlessCubemap: 0
- textureFormat: 1
+ textureFormat: -3
maxTextureSize: 2048
textureSettings:
- serializedVersion: 2
- filterMode: -1
+ filterMode: 1
aniso: 1
mipBias: -1
- wrapU: 1
- wrapV: 1
- wrapW: -1
+ wrapMode: 1
nPOTScale: 0
lightmap: 0
+ rGBM: 0
compressionQuality: 50
+ allowsAlphaSplitting: 0
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
@@ -47,40 +45,12 @@ TextureImporter:
spritePivot: {x: 0.5, y: 0.5}
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spritePixelsToUnits: 100
- alphaUsage: 1
alphaIsTransparency: 1
- spriteTessellationDetail: -1
textureType: 2
- textureShape: 1
- maxTextureSizeSet: 0
- compressionQualitySet: 0
- textureFormatSet: 0
- platformSettings:
- - buildTarget: DefaultTexturePlatform
- maxTextureSize: 2048
- resizeAlgorithm: 0
- textureFormat: -1
- textureCompression: 0
- compressionQuality: 50
- crunchedCompression: 0
- allowsAlphaSplitting: 0
- overridden: 0
- androidETC2FallbackOverride: 0
- - buildTarget: Standalone
- maxTextureSize: 2048
- resizeAlgorithm: 0
- textureFormat: -1
- textureCompression: 0
- compressionQuality: 50
- crunchedCompression: 0
- allowsAlphaSplitting: 0
- overridden: 0
- androidETC2FallbackOverride: 0
+ buildTargetSettings: []
spriteSheet:
- serializedVersion: 2
sprites: []
outline: []
- physicsShape: []
spritePackingTag:
userData:
assetBundleName:
diff --git a/Gizmos/ShapeEditorSegmentBezier.png.meta b/Gizmos/ShapeEditorSegmentBezier.png.meta
index 8fa47f47..6e3a037e 100644
--- a/Gizmos/ShapeEditorSegmentBezier.png.meta
+++ b/Gizmos/ShapeEditorSegmentBezier.png.meta
@@ -4,17 +4,14 @@ timeCreated: 1518385415
licenseType: Free
TextureImporter:
fileIDToRecycleName: {}
- externalObjects: {}
- serializedVersion: 4
+ serializedVersion: 2
mipmaps:
mipMapMode: 0
enableMipMap: 0
- sRGBTexture: 0
- linearTexture: 0
+ linearTexture: 1
+ correctGamma: 0
fadeOut: 0
borderMipMap: 0
- mipMapsPreserveCoverage: 0
- alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
@@ -24,22 +21,23 @@ TextureImporter:
normalMapFilter: 0
isReadable: 0
grayScaleToAlpha: 0
- generateCubemap: 6
+ generateCubemap: 0
cubemapConvolution: 0
+ cubemapConvolutionSteps: 7
+ cubemapConvolutionExponent: 1.5
seamlessCubemap: 0
- textureFormat: 1
+ textureFormat: -3
maxTextureSize: 2048
textureSettings:
- serializedVersion: 2
- filterMode: -1
+ filterMode: 1
aniso: 1
mipBias: -1
- wrapU: 1
- wrapV: 1
- wrapW: -1
+ wrapMode: 1
nPOTScale: 0
lightmap: 0
+ rGBM: 0
compressionQuality: 50
+ allowsAlphaSplitting: 0
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
@@ -47,40 +45,12 @@ TextureImporter:
spritePivot: {x: 0.5, y: 0.5}
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spritePixelsToUnits: 100
- alphaUsage: 1
alphaIsTransparency: 1
- spriteTessellationDetail: -1
textureType: 2
- textureShape: 1
- maxTextureSizeSet: 0
- compressionQualitySet: 0
- textureFormatSet: 0
- platformSettings:
- - buildTarget: DefaultTexturePlatform
- maxTextureSize: 2048
- resizeAlgorithm: 0
- textureFormat: -1
- textureCompression: 0
- compressionQuality: 50
- crunchedCompression: 0
- allowsAlphaSplitting: 0
- overridden: 0
- androidETC2FallbackOverride: 0
- - buildTarget: Standalone
- maxTextureSize: 2048
- resizeAlgorithm: 0
- textureFormat: -1
- textureCompression: 0
- compressionQuality: 50
- crunchedCompression: 0
- allowsAlphaSplitting: 0
- overridden: 0
- androidETC2FallbackOverride: 0
+ buildTargetSettings: []
spriteSheet:
- serializedVersion: 2
sprites: []
outline: []
- physicsShape: []
spritePackingTag:
userData:
assetBundleName:
diff --git a/Gizmos/ShapeEditorSegmentBezierDetail.png.meta b/Gizmos/ShapeEditorSegmentBezierDetail.png.meta
index 4548787d..73611315 100644
--- a/Gizmos/ShapeEditorSegmentBezierDetail.png.meta
+++ b/Gizmos/ShapeEditorSegmentBezierDetail.png.meta
@@ -4,17 +4,14 @@ timeCreated: 1518467959
licenseType: Free
TextureImporter:
fileIDToRecycleName: {}
- externalObjects: {}
- serializedVersion: 4
+ serializedVersion: 2
mipmaps:
mipMapMode: 0
enableMipMap: 0
- sRGBTexture: 0
- linearTexture: 0
+ linearTexture: 1
+ correctGamma: 0
fadeOut: 0
borderMipMap: 0
- mipMapsPreserveCoverage: 0
- alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
@@ -24,22 +21,23 @@ TextureImporter:
normalMapFilter: 0
isReadable: 0
grayScaleToAlpha: 0
- generateCubemap: 6
+ generateCubemap: 0
cubemapConvolution: 0
+ cubemapConvolutionSteps: 7
+ cubemapConvolutionExponent: 1.5
seamlessCubemap: 0
- textureFormat: 1
+ textureFormat: -3
maxTextureSize: 2048
textureSettings:
- serializedVersion: 2
- filterMode: -1
+ filterMode: 1
aniso: 1
mipBias: -1
- wrapU: 1
- wrapV: 1
- wrapW: -1
+ wrapMode: 1
nPOTScale: 0
lightmap: 0
+ rGBM: 0
compressionQuality: 50
+ allowsAlphaSplitting: 0
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
@@ -47,40 +45,12 @@ TextureImporter:
spritePivot: {x: 0.5, y: 0.5}
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spritePixelsToUnits: 100
- alphaUsage: 1
alphaIsTransparency: 1
- spriteTessellationDetail: -1
textureType: 2
- textureShape: 1
- maxTextureSizeSet: 0
- compressionQualitySet: 0
- textureFormatSet: 0
- platformSettings:
- - buildTarget: DefaultTexturePlatform
- maxTextureSize: 2048
- resizeAlgorithm: 0
- textureFormat: -1
- textureCompression: 0
- compressionQuality: 50
- crunchedCompression: 0
- allowsAlphaSplitting: 0
- overridden: 0
- androidETC2FallbackOverride: 0
- - buildTarget: Standalone
- maxTextureSize: 2048
- resizeAlgorithm: 0
- textureFormat: -1
- textureCompression: 0
- compressionQuality: 50
- crunchedCompression: 0
- allowsAlphaSplitting: 0
- overridden: 0
- androidETC2FallbackOverride: 0
+ buildTargetSettings: []
spriteSheet:
- serializedVersion: 2
sprites: []
outline: []
- physicsShape: []
spritePackingTag:
userData:
assetBundleName:
diff --git a/Gizmos/ShapeEditorSegmentInsert.png.meta b/Gizmos/ShapeEditorSegmentInsert.png.meta
index 790a3d89..7b51135c 100644
--- a/Gizmos/ShapeEditorSegmentInsert.png.meta
+++ b/Gizmos/ShapeEditorSegmentInsert.png.meta
@@ -4,17 +4,14 @@ timeCreated: 1518386878
licenseType: Free
TextureImporter:
fileIDToRecycleName: {}
- externalObjects: {}
- serializedVersion: 4
+ serializedVersion: 2
mipmaps:
mipMapMode: 0
enableMipMap: 0
- sRGBTexture: 0
- linearTexture: 0
+ linearTexture: 1
+ correctGamma: 0
fadeOut: 0
borderMipMap: 0
- mipMapsPreserveCoverage: 0
- alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
@@ -24,22 +21,23 @@ TextureImporter:
normalMapFilter: 0
isReadable: 0
grayScaleToAlpha: 0
- generateCubemap: 6
+ generateCubemap: 0
cubemapConvolution: 0
+ cubemapConvolutionSteps: 7
+ cubemapConvolutionExponent: 1.5
seamlessCubemap: 0
- textureFormat: 1
+ textureFormat: -3
maxTextureSize: 2048
textureSettings:
- serializedVersion: 2
- filterMode: -1
+ filterMode: 1
aniso: 1
mipBias: -1
- wrapU: 1
- wrapV: 1
- wrapW: -1
+ wrapMode: 1
nPOTScale: 0
lightmap: 0
+ rGBM: 0
compressionQuality: 50
+ allowsAlphaSplitting: 0
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
@@ -47,40 +45,12 @@ TextureImporter:
spritePivot: {x: 0.5, y: 0.5}
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spritePixelsToUnits: 100
- alphaUsage: 1
alphaIsTransparency: 1
- spriteTessellationDetail: -1
textureType: 2
- textureShape: 1
- maxTextureSizeSet: 0
- compressionQualitySet: 0
- textureFormatSet: 0
- platformSettings:
- - buildTarget: DefaultTexturePlatform
- maxTextureSize: 2048
- resizeAlgorithm: 0
- textureFormat: -1
- textureCompression: 0
- compressionQuality: 50
- crunchedCompression: 0
- allowsAlphaSplitting: 0
- overridden: 0
- androidETC2FallbackOverride: 0
- - buildTarget: Standalone
- maxTextureSize: 2048
- resizeAlgorithm: 0
- textureFormat: -1
- textureCompression: 0
- compressionQuality: 50
- crunchedCompression: 0
- allowsAlphaSplitting: 0
- overridden: 0
- androidETC2FallbackOverride: 0
+ buildTargetSettings: []
spriteSheet:
- serializedVersion: 2
sprites: []
outline: []
- physicsShape: []
spritePackingTag:
userData:
assetBundleName:
diff --git a/Gizmos/ShapeEditorSegmentLinear.png.meta b/Gizmos/ShapeEditorSegmentLinear.png.meta
index d4b11b83..1f9f35f9 100644
--- a/Gizmos/ShapeEditorSegmentLinear.png.meta
+++ b/Gizmos/ShapeEditorSegmentLinear.png.meta
@@ -4,17 +4,14 @@ timeCreated: 1518385415
licenseType: Free
TextureImporter:
fileIDToRecycleName: {}
- externalObjects: {}
- serializedVersion: 4
+ serializedVersion: 2
mipmaps:
mipMapMode: 0
enableMipMap: 0
- sRGBTexture: 0
- linearTexture: 0
+ linearTexture: 1
+ correctGamma: 0
fadeOut: 0
borderMipMap: 0
- mipMapsPreserveCoverage: 0
- alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
@@ -24,22 +21,23 @@ TextureImporter:
normalMapFilter: 0
isReadable: 0
grayScaleToAlpha: 0
- generateCubemap: 6
+ generateCubemap: 0
cubemapConvolution: 0
+ cubemapConvolutionSteps: 7
+ cubemapConvolutionExponent: 1.5
seamlessCubemap: 0
- textureFormat: 1
+ textureFormat: -3
maxTextureSize: 2048
textureSettings:
- serializedVersion: 2
- filterMode: -1
+ filterMode: 1
aniso: 1
mipBias: -1
- wrapU: 1
- wrapV: 1
- wrapW: -1
+ wrapMode: 1
nPOTScale: 0
lightmap: 0
+ rGBM: 0
compressionQuality: 50
+ allowsAlphaSplitting: 0
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
@@ -47,40 +45,12 @@ TextureImporter:
spritePivot: {x: 0.5, y: 0.5}
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spritePixelsToUnits: 100
- alphaUsage: 1
alphaIsTransparency: 1
- spriteTessellationDetail: -1
textureType: 2
- textureShape: 1
- maxTextureSizeSet: 0
- compressionQualitySet: 0
- textureFormatSet: 0
- platformSettings:
- - buildTarget: DefaultTexturePlatform
- maxTextureSize: 2048
- resizeAlgorithm: 0
- textureFormat: -1
- textureCompression: 0
- compressionQuality: 50
- crunchedCompression: 0
- allowsAlphaSplitting: 0
- overridden: 0
- androidETC2FallbackOverride: 0
- - buildTarget: Standalone
- maxTextureSize: 2048
- resizeAlgorithm: 0
- textureFormat: -1
- textureCompression: 0
- compressionQuality: 50
- crunchedCompression: 0
- allowsAlphaSplitting: 0
- overridden: 0
- androidETC2FallbackOverride: 0
+ buildTargetSettings: []
spriteSheet:
- serializedVersion: 2
sprites: []
outline: []
- physicsShape: []
spritePackingTag:
userData:
assetBundleName:
diff --git a/Gizmos/ShapeEditorShapeCreate.png.meta b/Gizmos/ShapeEditorShapeCreate.png.meta
index 3f2bccc6..b7bee740 100644
--- a/Gizmos/ShapeEditorShapeCreate.png.meta
+++ b/Gizmos/ShapeEditorShapeCreate.png.meta
@@ -4,17 +4,14 @@ timeCreated: 1518453820
licenseType: Free
TextureImporter:
fileIDToRecycleName: {}
- externalObjects: {}
- serializedVersion: 4
+ serializedVersion: 2
mipmaps:
mipMapMode: 0
enableMipMap: 0
- sRGBTexture: 0
- linearTexture: 0
+ linearTexture: 1
+ correctGamma: 0
fadeOut: 0
borderMipMap: 0
- mipMapsPreserveCoverage: 0
- alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
@@ -24,22 +21,23 @@ TextureImporter:
normalMapFilter: 0
isReadable: 0
grayScaleToAlpha: 0
- generateCubemap: 6
+ generateCubemap: 0
cubemapConvolution: 0
+ cubemapConvolutionSteps: 7
+ cubemapConvolutionExponent: 1.5
seamlessCubemap: 0
- textureFormat: 1
+ textureFormat: -3
maxTextureSize: 2048
textureSettings:
- serializedVersion: 2
- filterMode: -1
+ filterMode: 1
aniso: 1
mipBias: -1
- wrapU: 1
- wrapV: 1
- wrapW: -1
+ wrapMode: 1
nPOTScale: 0
lightmap: 0
+ rGBM: 0
compressionQuality: 50
+ allowsAlphaSplitting: 0
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
@@ -47,40 +45,12 @@ TextureImporter:
spritePivot: {x: 0.5, y: 0.5}
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spritePixelsToUnits: 100
- alphaUsage: 1
alphaIsTransparency: 1
- spriteTessellationDetail: -1
textureType: 2
- textureShape: 1
- maxTextureSizeSet: 0
- compressionQualitySet: 0
- textureFormatSet: 0
- platformSettings:
- - buildTarget: DefaultTexturePlatform
- maxTextureSize: 2048
- resizeAlgorithm: 0
- textureFormat: -1
- textureCompression: 0
- compressionQuality: 50
- crunchedCompression: 0
- allowsAlphaSplitting: 0
- overridden: 0
- androidETC2FallbackOverride: 0
- - buildTarget: Standalone
- maxTextureSize: 2048
- resizeAlgorithm: 0
- textureFormat: -1
- textureCompression: 0
- compressionQuality: 50
- crunchedCompression: 0
- allowsAlphaSplitting: 0
- overridden: 0
- androidETC2FallbackOverride: 0
+ buildTargetSettings: []
spriteSheet:
- serializedVersion: 2
sprites: []
outline: []
- physicsShape: []
spritePackingTag:
userData:
assetBundleName:
diff --git a/Gizmos/ShapeEditorShapeDuplicate.png.meta b/Gizmos/ShapeEditorShapeDuplicate.png.meta
index 5f68a14a..169b8524 100644
--- a/Gizmos/ShapeEditorShapeDuplicate.png.meta
+++ b/Gizmos/ShapeEditorShapeDuplicate.png.meta
@@ -4,17 +4,14 @@ timeCreated: 1518953319
licenseType: Free
TextureImporter:
fileIDToRecycleName: {}
- externalObjects: {}
- serializedVersion: 4
+ serializedVersion: 2
mipmaps:
mipMapMode: 0
enableMipMap: 0
- sRGBTexture: 0
- linearTexture: 0
+ linearTexture: 1
+ correctGamma: 0
fadeOut: 0
borderMipMap: 0
- mipMapsPreserveCoverage: 0
- alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
@@ -24,22 +21,23 @@ TextureImporter:
normalMapFilter: 0
isReadable: 0
grayScaleToAlpha: 0
- generateCubemap: 6
+ generateCubemap: 0
cubemapConvolution: 0
+ cubemapConvolutionSteps: 7
+ cubemapConvolutionExponent: 1.5
seamlessCubemap: 0
- textureFormat: 1
+ textureFormat: -3
maxTextureSize: 2048
textureSettings:
- serializedVersion: 2
- filterMode: -1
+ filterMode: 1
aniso: 1
mipBias: -1
- wrapU: 1
- wrapV: 1
- wrapW: -1
+ wrapMode: 1
nPOTScale: 0
lightmap: 0
+ rGBM: 0
compressionQuality: 50
+ allowsAlphaSplitting: 0
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
@@ -47,40 +45,12 @@ TextureImporter:
spritePivot: {x: 0.5, y: 0.5}
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spritePixelsToUnits: 100
- alphaUsage: 1
alphaIsTransparency: 1
- spriteTessellationDetail: -1
textureType: 2
- textureShape: 1
- maxTextureSizeSet: 0
- compressionQualitySet: 0
- textureFormatSet: 0
- platformSettings:
- - buildTarget: DefaultTexturePlatform
- maxTextureSize: 2048
- resizeAlgorithm: 0
- textureFormat: -1
- textureCompression: 0
- compressionQuality: 50
- crunchedCompression: 0
- allowsAlphaSplitting: 0
- overridden: 0
- androidETC2FallbackOverride: 0
- - buildTarget: Standalone
- maxTextureSize: 2048
- resizeAlgorithm: 0
- textureFormat: -1
- textureCompression: 0
- compressionQuality: 50
- crunchedCompression: 0
- allowsAlphaSplitting: 0
- overridden: 0
- androidETC2FallbackOverride: 0
+ buildTargetSettings: []
spriteSheet:
- serializedVersion: 2
sprites: []
outline: []
- physicsShape: []
spritePackingTag:
userData:
assetBundleName:
diff --git a/Gizmos/ShapeEditorZoomIn.png.meta b/Gizmos/ShapeEditorZoomIn.png.meta
index 05035782..ace22990 100644
--- a/Gizmos/ShapeEditorZoomIn.png.meta
+++ b/Gizmos/ShapeEditorZoomIn.png.meta
@@ -4,17 +4,14 @@ timeCreated: 1518386878
licenseType: Free
TextureImporter:
fileIDToRecycleName: {}
- externalObjects: {}
- serializedVersion: 4
+ serializedVersion: 2
mipmaps:
mipMapMode: 0
enableMipMap: 0
- sRGBTexture: 0
- linearTexture: 0
+ linearTexture: 1
+ correctGamma: 0
fadeOut: 0
borderMipMap: 0
- mipMapsPreserveCoverage: 0
- alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
@@ -24,22 +21,23 @@ TextureImporter:
normalMapFilter: 0
isReadable: 0
grayScaleToAlpha: 0
- generateCubemap: 6
+ generateCubemap: 0
cubemapConvolution: 0
+ cubemapConvolutionSteps: 7
+ cubemapConvolutionExponent: 1.5
seamlessCubemap: 0
- textureFormat: 1
+ textureFormat: -3
maxTextureSize: 2048
textureSettings:
- serializedVersion: 2
- filterMode: -1
+ filterMode: 1
aniso: 1
mipBias: -1
- wrapU: 1
- wrapV: 1
- wrapW: -1
+ wrapMode: 1
nPOTScale: 0
lightmap: 0
+ rGBM: 0
compressionQuality: 50
+ allowsAlphaSplitting: 0
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
@@ -47,40 +45,12 @@ TextureImporter:
spritePivot: {x: 0.5, y: 0.5}
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spritePixelsToUnits: 100
- alphaUsage: 1
alphaIsTransparency: 1
- spriteTessellationDetail: -1
textureType: 2
- textureShape: 1
- maxTextureSizeSet: 0
- compressionQualitySet: 0
- textureFormatSet: 0
- platformSettings:
- - buildTarget: DefaultTexturePlatform
- maxTextureSize: 2048
- resizeAlgorithm: 0
- textureFormat: -1
- textureCompression: 0
- compressionQuality: 50
- crunchedCompression: 0
- allowsAlphaSplitting: 0
- overridden: 0
- androidETC2FallbackOverride: 0
- - buildTarget: Standalone
- maxTextureSize: 2048
- resizeAlgorithm: 0
- textureFormat: -1
- textureCompression: 0
- compressionQuality: 50
- crunchedCompression: 0
- allowsAlphaSplitting: 0
- overridden: 0
- androidETC2FallbackOverride: 0
+ buildTargetSettings: []
spriteSheet:
- serializedVersion: 2
sprites: []
outline: []
- physicsShape: []
spritePackingTag:
userData:
assetBundleName:
diff --git a/Gizmos/ShapeEditorZoomOut.png.meta b/Gizmos/ShapeEditorZoomOut.png.meta
index 4013b968..8b76b191 100644
--- a/Gizmos/ShapeEditorZoomOut.png.meta
+++ b/Gizmos/ShapeEditorZoomOut.png.meta
@@ -4,17 +4,14 @@ timeCreated: 1518386878
licenseType: Free
TextureImporter:
fileIDToRecycleName: {}
- externalObjects: {}
- serializedVersion: 4
+ serializedVersion: 2
mipmaps:
mipMapMode: 0
enableMipMap: 0
- sRGBTexture: 0
- linearTexture: 0
+ linearTexture: 1
+ correctGamma: 0
fadeOut: 0
borderMipMap: 0
- mipMapsPreserveCoverage: 0
- alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
@@ -24,22 +21,23 @@ TextureImporter:
normalMapFilter: 0
isReadable: 0
grayScaleToAlpha: 0
- generateCubemap: 6
+ generateCubemap: 0
cubemapConvolution: 0
+ cubemapConvolutionSteps: 7
+ cubemapConvolutionExponent: 1.5
seamlessCubemap: 0
- textureFormat: 1
+ textureFormat: -3
maxTextureSize: 2048
textureSettings:
- serializedVersion: 2
- filterMode: -1
+ filterMode: 1
aniso: 1
mipBias: -1
- wrapU: 1
- wrapV: 1
- wrapW: -1
+ wrapMode: 1
nPOTScale: 0
lightmap: 0
+ rGBM: 0
compressionQuality: 50
+ allowsAlphaSplitting: 0
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
@@ -47,40 +45,12 @@ TextureImporter:
spritePivot: {x: 0.5, y: 0.5}
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spritePixelsToUnits: 100
- alphaUsage: 1
alphaIsTransparency: 1
- spriteTessellationDetail: -1
textureType: 2
- textureShape: 1
- maxTextureSizeSet: 0
- compressionQualitySet: 0
- textureFormatSet: 0
- platformSettings:
- - buildTarget: DefaultTexturePlatform
- maxTextureSize: 2048
- resizeAlgorithm: 0
- textureFormat: -1
- textureCompression: 0
- compressionQuality: 50
- crunchedCompression: 0
- allowsAlphaSplitting: 0
- overridden: 0
- androidETC2FallbackOverride: 0
- - buildTarget: Standalone
- maxTextureSize: 2048
- resizeAlgorithm: 0
- textureFormat: -1
- textureCompression: 0
- compressionQuality: 50
- crunchedCompression: 0
- allowsAlphaSplitting: 0
- overridden: 0
- androidETC2FallbackOverride: 0
+ buildTargetSettings: []
spriteSheet:
- serializedVersion: 2
sprites: []
outline: []
- physicsShape: []
spritePackingTag:
userData:
assetBundleName:
diff --git a/Internal/Shaders/BrushPreview.shader b/Internal/Shaders/BrushPreview.shader
index ffafc061..609f718e 100644
--- a/Internal/Shaders/BrushPreview.shader
+++ b/Internal/Shaders/BrushPreview.shader
@@ -1,32 +1,35 @@
// Based on "Legacy Shaders/Transparent/Diffuse"
Shader "SabreCSG/BrushPreview"
{
-Properties {
- _Color ("Main Color", Color) = (1,1,1,1)
-}
+ Properties
+ {
+ _Color ("Main Color", Color) = (1,1,1,1)
+ }
-SubShader {
- Fog { Mode Off }
- Tags {"Queue"="Transparent" "IgnoreProjector"="True" "RenderType"="Transparent"}
- LOD 200
+ SubShader
+ {
+ Fog { Mode Off }
+ Tags {"Queue"="Transparent" "IgnoreProjector"="True" "RenderType"="Transparent"}
+ LOD 200
-CGPROGRAM
-#pragma surface surf Lambert alpha:blend nofog
+ CGPROGRAM
+ #pragma surface surf Lambert alpha:blend nofog
-fixed4 _Color;
+ fixed4 _Color;
-struct Input {
- fixed4 color; // Can't declare empty structs in CG, so just put a filler variable to get it compiling
-};
+ struct Input
+ {
+ fixed4 color; // Can't declare empty structs in CG, so just put a filler variable to get it compiling
+ };
-void surf (Input IN, inout SurfaceOutput o) {
- fixed4 c = _Color;
-
- o.Albedo = c.rgb;
- o.Alpha = c.a;
-}
-ENDCG
-}
+ void surf (Input IN, inout SurfaceOutput o)
+ {
+ fixed4 c = _Color;
+ o.Albedo = c.rgb;
+ o.Alpha = c.a;
+ }
+ ENDCG
+ }
-Fallback "Legacy Shaders/Transparent/VertexLit"
-}
+ Fallback "Legacy Shaders/Transparent/VertexLit"
+}
\ No newline at end of file
diff --git a/Internal/Shaders/Grayscale-GUITexture.shader b/Internal/Shaders/Grayscale-GUITexture.shader
index d0641748..0740d98d 100644
--- a/Internal/Shaders/Grayscale-GUITexture.shader
+++ b/Internal/Shaders/Grayscale-GUITexture.shader
@@ -1,60 +1,63 @@
-
-Shader "Hidden/Grayscale-GUITexture"
+Shader "Hidden/Grayscale-GUITexture"
{
- Properties { _MainTex ("Texture", any) = "" {} }
-
- SubShader {
+ Properties
+ {
+ _MainTex ("Texture", any) = "" {}
+ }
- Tags { "ForceSupported" = "True" "RenderType"="Overlay" }
+ SubShader
+ {
+ Tags { "ForceSupported" = "True" "RenderType"="Overlay" }
+ Lighting Off
+ Blend SrcAlpha OneMinusSrcAlpha
+ Cull Off
+ ZWrite Off
+ ZTest Always
- Lighting Off
- Blend SrcAlpha OneMinusSrcAlpha
- Cull Off
- ZWrite Off
- ZTest Always
-
- Pass {
+ Pass
+ {
CGPROGRAM
- #pragma vertex vert
- #pragma fragment frag
+ #pragma vertex vert
+ #pragma fragment frag
- #include "UnityCG.cginc"
+ #include "UnityCG.cginc"
- struct appdata_t {
- float4 vertex : POSITION;
- fixed4 color : COLOR;
- float2 texcoord : TEXCOORD0;
- };
+ struct appdata_t
+ {
+ float4 vertex : POSITION;
+ fixed4 color : COLOR;
+ float2 texcoord : TEXCOORD0;
+ };
- struct v2f {
- float4 vertex : SV_POSITION;
- fixed4 color : COLOR;
- float2 texcoord : TEXCOORD0;
- };
+ struct v2f
+ {
+ float4 vertex : SV_POSITION;
+ fixed4 color : COLOR;
+ float2 texcoord : TEXCOORD0;
+ };
- sampler2D _MainTex;
+ sampler2D _MainTex;
- uniform float4 _MainTex_ST;
+ uniform float4 _MainTex_ST;
- v2f vert (appdata_t v)
- {
- v2f o;
- o.vertex = mul(UNITY_MATRIX_MVP, v.vertex);
- o.color = v.color;
- o.texcoord = TRANSFORM_TEX(v.texcoord,_MainTex);
- return o;
- }
-
- fixed4 frag (v2f i) : SV_Target
- {
- fixed4 col = tex2D(_MainTex, i.texcoord);
- col.rgb = dot(float3(0.222, 0.707, 0.071), col.rgb);
-
- return 2.0f * col * i.color;
- }
- ENDCG
+ v2f vert (appdata_t v)
+ {
+ v2f o;
+ o.vertex = mul(UNITY_MATRIX_MVP, v.vertex);
+ o.color = v.color;
+ o.texcoord = TRANSFORM_TEX(v.texcoord,_MainTex);
+ return o;
+ }
+
+ fixed4 frag (v2f i) : SV_Target
+ {
+ fixed4 col = tex2D(_MainTex, i.texcoord);
+ col.rgb = dot(float3(0.222, 0.707, 0.071), col.rgb);
+ return 2.0f * col * i.color;
+ }
+ ENDCG
}
- }
+ }
- Fallback off
-}
+ Fallback off
+}
\ No newline at end of file
diff --git a/Resources/Materials/Default_Map.mat b/Resources/Materials/Default_Map.mat
index 412ccdf5..a4269713 100644
--- a/Resources/Materials/Default_Map.mat
+++ b/Resources/Materials/Default_Map.mat
@@ -8,120 +8,131 @@ Material:
m_PrefabInternal: {fileID: 0}
m_Name: Default_Map
m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0}
- m_ShaderKeywords: _EMISSION
- m_LightmapFlags: 1
+ m_ShaderKeywords:
+ m_LightmapFlags: 5
m_CustomRenderQueue: -1
stringTagMap: {}
m_SavedProperties:
serializedVersion: 2
m_TexEnvs:
- - first:
- name: _BumpMap
- second:
- m_Texture: {fileID: 0}
- m_Scale: {x: 1, y: 1}
- m_Offset: {x: 0, y: 0}
- - first:
- name: _DetailAlbedoMap
- second:
- m_Texture: {fileID: 0}
- m_Scale: {x: 1, y: 1}
- m_Offset: {x: 0, y: 0}
- - first:
- name: _DetailMask
- second:
- m_Texture: {fileID: 0}
- m_Scale: {x: 1, y: 1}
- m_Offset: {x: 0, y: 0}
- - first:
- name: _DetailNormalMap
- second:
- m_Texture: {fileID: 0}
- m_Scale: {x: 1, y: 1}
- m_Offset: {x: 0, y: 0}
- - first:
- name: _EmissionMap
- second:
- m_Texture: {fileID: 0}
- m_Scale: {x: 1, y: 1}
- m_Offset: {x: 0, y: 0}
- - first:
- name: _MainTex
- second:
- m_Texture: {fileID: 2800000, guid: bc294e81e859f4f22805f2590df93571, type: 3}
- m_Scale: {x: 1, y: 1}
- m_Offset: {x: 0, y: 0}
- - first:
- name: _MetallicGlossMap
- second:
- m_Texture: {fileID: 0}
- m_Scale: {x: 1, y: 1}
- m_Offset: {x: 0, y: 0}
- - first:
- name: _OcclusionMap
- second:
- m_Texture: {fileID: 0}
- m_Scale: {x: 1, y: 1}
- m_Offset: {x: 0, y: 0}
- - first:
- name: _ParallaxMap
- second:
- m_Texture: {fileID: 0}
- m_Scale: {x: 1, y: 1}
- m_Offset: {x: 0, y: 0}
+ data:
+ first:
+ name: _MainTex
+ second:
+ m_Texture: {fileID: 2800000, guid: 854edb35bcc9f4b7cbf8efafd877d736, type: 3}
+ m_Scale: {x: 1, y: 1}
+ m_Offset: {x: 0, y: 0}
+ data:
+ first:
+ name: _BumpMap
+ second:
+ m_Texture: {fileID: 0}
+ m_Scale: {x: 1, y: 1}
+ m_Offset: {x: 0, y: 0}
+ data:
+ first:
+ name: _DetailNormalMap
+ second:
+ m_Texture: {fileID: 0}
+ m_Scale: {x: 1, y: 1}
+ m_Offset: {x: 0, y: 0}
+ data:
+ first:
+ name: _ParallaxMap
+ second:
+ m_Texture: {fileID: 0}
+ m_Scale: {x: 1, y: 1}
+ m_Offset: {x: 0, y: 0}
+ data:
+ first:
+ name: _OcclusionMap
+ second:
+ m_Texture: {fileID: 0}
+ m_Scale: {x: 1, y: 1}
+ m_Offset: {x: 0, y: 0}
+ data:
+ first:
+ name: _EmissionMap
+ second:
+ m_Texture: {fileID: 0}
+ m_Scale: {x: 1, y: 1}
+ m_Offset: {x: 0, y: 0}
+ data:
+ first:
+ name: _DetailMask
+ second:
+ m_Texture: {fileID: 0}
+ m_Scale: {x: 1, y: 1}
+ m_Offset: {x: 0, y: 0}
+ data:
+ first:
+ name: _DetailAlbedoMap
+ second:
+ m_Texture: {fileID: 0}
+ m_Scale: {x: 1, y: 1}
+ m_Offset: {x: 0, y: 0}
+ data:
+ first:
+ name: _MetallicGlossMap
+ second:
+ m_Texture: {fileID: 0}
+ m_Scale: {x: 1, y: 1}
+ m_Offset: {x: 0, y: 0}
m_Floats:
- - first:
- name: _BumpScale
- second: 1
- - first:
- name: _Cutoff
- second: 0.5
- - first:
- name: _DetailNormalMapScale
- second: 1
- - first:
- name: _DstBlend
- second: 0
- - first:
- name: _GlossMapScale
- second: 1
- - first:
- name: _Glossiness
- second: 0.28
- - first:
- name: _GlossyReflections
- second: 1
- - first:
- name: _Metallic
- second: 0
- - first:
- name: _Mode
- second: 0
- - first:
- name: _OcclusionStrength
- second: 1
- - first:
- name: _Parallax
- second: 0.02
- - first:
- name: _SmoothnessTextureChannel
- second: 0
- - first:
- name: _SpecularHighlights
- second: 1
- - first:
- name: _SrcBlend
- second: 1
- - first:
- name: _UVSec
- second: 0
- - first:
- name: _ZWrite
- second: 1
+ data:
+ first:
+ name: _SrcBlend
+ second: 1
+ data:
+ first:
+ name: _DstBlend
+ second: 0
+ data:
+ first:
+ name: _Cutoff
+ second: 0.5
+ data:
+ first:
+ name: _Parallax
+ second: 0.02
+ data:
+ first:
+ name: _ZWrite
+ second: 1
+ data:
+ first:
+ name: _Glossiness
+ second: 0.365
+ data:
+ first:
+ name: _BumpScale
+ second: 1
+ data:
+ first:
+ name: _OcclusionStrength
+ second: 1
+ data:
+ first:
+ name: _DetailNormalMapScale
+ second: 1
+ data:
+ first:
+ name: _UVSec
+ second: 0
+ data:
+ first:
+ name: _Mode
+ second: 0
+ data:
+ first:
+ name: _Metallic
+ second: 0
m_Colors:
- - first:
- name: _Color
- second: {r: 1, g: 1, b: 1, a: 1}
- - first:
- name: _EmissionColor
- second: {r: 0, g: 0, b: 0, a: 1}
+ data:
+ first:
+ name: _EmissionColor
+ second: {r: 0, g: 0, b: 0, a: 1}
+ data:
+ first:
+ name: _Color
+ second: {r: 1, g: 1, b: 1, a: 1}
diff --git a/Scripts/Brushes/CompoundBrush.cs b/Scripts/Brushes/CompoundBrush.cs
index 3942cacc..e2987039 100644
--- a/Scripts/Brushes/CompoundBrush.cs
+++ b/Scripts/Brushes/CompoundBrush.cs
@@ -42,7 +42,19 @@ public CSGModelBase GetCSGModel()
return parentCsgModel;
}
- protected virtual void Start()
+ ///
+ /// Gets the beautiful name of the brush used in auto-generation of the hierarchy name.
+ ///
+ /// The beautiful name of the brush.
+ public override string BeautifulBrushName
+ {
+ get
+ {
+ return GetType().Name;
+ }
+ }
+
+ protected virtual void Start()
{
generatedBrushes = new List(GetComponentsInChildren());
for (int i = 0; i < generatedBrushes.Count; i++)
@@ -53,6 +65,8 @@ protected virtual void Start()
public override void Invalidate (bool polygonsChanged)
{
+ base.Invalidate(polygonsChanged);
+
generatedBrushes.RemoveAll(item => item == null);
if(generatedBrushes.Count > BrushCount)
{
@@ -180,6 +194,49 @@ public override Bounds GetBoundsLocalTo(Transform otherTransform)
return bounds;
}
+ ///
+ /// Gets all of the polygons from all brushes in this compound brush.
+ ///
+ /// All of the polygons from all brushes in this compound brush.
+ public Polygon[] GetPolygons()
+ {
+ List polygons = new List();
+ // iterate through all child brushes:
+ foreach (Brush brush in GetComponentsInChildren())
+ {
+ polygons.AddRange(GenerateTransformedPolygons(brush.transform, brush.GetPolygons()));
+ }
+ return polygons.ToArray();
+ }
+
+ ///
+ /// Generates transformed polygons to match the compound brush position.
+ ///
+ /// The transform of a child brush.
+ /// The polygons of a child brush.
+ /// The transformed polygons.
+ private Polygon[] GenerateTransformedPolygons(Transform t, Polygon[] polygons)
+ {
+ Polygon[] polygonsCopy = polygons.DeepCopy();
+
+ Vector3 center = t.localPosition;
+ Quaternion rotation = t.localRotation;
+ Vector3 scale = t.lossyScale;
+
+ for (int i = 0; i < polygonsCopy.Length; i++)
+ {
+ for (int j = 0; j < polygonsCopy[i].Vertices.Length; j++)
+ {
+ polygonsCopy[i].Vertices[j].Position = rotation * polygonsCopy[i].Vertices[j].Position.Multiply(scale) + center;
+ polygonsCopy[i].Vertices[j].Normal = rotation * polygonsCopy[i].Vertices[j].Normal;
+ }
+
+ // Just updated a load of vertex positions, so make sure the cached plane is updated
+ polygonsCopy[i].CalculatePlane();
+ }
+
+ return polygonsCopy;
+ }
public virtual PrimitiveBrush CreateBrush()
{
diff --git a/Scripts/Brushes/CompoundBrushes/CurvedStairBrush.cs b/Scripts/Brushes/CompoundBrushes/CurvedStairBrush.cs
index 2fcd0819..f00681b6 100644
--- a/Scripts/Brushes/CompoundBrushes/CurvedStairBrush.cs
+++ b/Scripts/Brushes/CompoundBrushes/CurvedStairBrush.cs
@@ -18,53 +18,132 @@ public class CurvedStairBrush : CompoundBrush
[SerializeField]
float innerRadius = 1.0f;
+ ///
+ /// Gets or sets the radius in meters in the center of the staircase.
+ ///
+ /// The radius in meters in the center of the staircase.
+ public float InnerRadius { get { return innerRadius; } set { innerRadius = value; } }
+
/// The height of each step.
[SerializeField]
float stepHeight = 0.0625f;
+ ///
+ /// Gets or sets the height of each step.
+ ///
+ /// The height of each step.
+ public float StepHeight { get { return stepHeight; } set { stepHeight = value; } }
+
/// The width of each step.
[SerializeField]
float stepWidth = 1.0f;
+ ///
+ /// Gets or sets the width of each step.
+ ///
+ /// The width of each step.
+ public float StepWidth { get { return stepWidth; } set { stepWidth = value; } }
+
/// The amount of curvature in degrees.
[SerializeField]
float angleOfCurve = 90.0f;
+ ///
+ /// Gets or sets the amount of curvature in degrees.
+ ///
+ /// The amount of curvature in degrees.
+ public float AngleOfCurve { get { return angleOfCurve; } set { angleOfCurve = value; } }
+
/// The amount of steps on the staircase.
[SerializeField]
int numSteps = 4;
+ ///
+ /// Gets or sets the amount of steps on the staircase.
+ ///
+ /// The amount of steps on the staircase.
+ public int NumberOfSteps { get { return numSteps; } set { numSteps = value; } }
+
/// An amount of height to add to the first stair step.
[SerializeField]
float addToFirstStep = 0.0f;
+ ///
+ /// Gets or sets an amount of height to add to the first stair step.
+ ///
+ /// An amount of height to add to the first stair step.
+ public float AddToFirstStep { get { return addToFirstStep; } set { addToFirstStep = value; } }
+
/// Whether the stairs are mirrored counter-clockwise.
[SerializeField]
bool counterClockwise = false;
+ ///
+ /// Gets or sets a value indicating whether the stairs are mirrored counter-clockwise.
+ ///
+ /// true if the stairs are mirrored counter-clockwise; otherwise, false.
+ public bool CounterClockwise { get { return counterClockwise; } set { counterClockwise = value; } }
+
/// Whether the stairs reach down to the bottom.
[SerializeField]
bool fillToBottom = true;
+ ///
+ /// Gets or sets a value indicating whether the stairs reach down to the bottom.
+ ///
+ /// true if the stairs reach down to the bottom; otherwise, false.
+ public bool FillToBottom { get { return fillToBottom; } set { fillToBottom = value; } }
+
/// Whether to generate stairs or a curved wall.
[SerializeField]
bool curvedWall = false;
+ ///
+ /// Gets or sets a value indicating whether to generate stairs or a curved wall.
+ ///
+ /// true if it generates stairs; otherwise, false to generate a curved wall.
+ public bool CurvedWall { get { return curvedWall; } set { curvedWall = value; } }
+
/// Whether the floor is stairs or a smooth slope.
[SerializeField]
bool slopedFloor = false;
+ ///
+ /// Gets or sets a value indicating whether the floor is stairs or a smooth slope.
+ ///
+ /// true if the floor is a smooth slope; otherwise, false if the floor is stairs.
+ public bool SlopedFloor { get { return slopedFloor; } set { slopedFloor = value; } }
+
/// Whether the ceiling is stairs or a smooth slope.
[SerializeField]
bool slopedCeiling = false;
+ ///
+ /// Gets or sets a value indicating whether the ceiling is stairs or a smooth slope.
+ ///
+ /// true if the ceiling is a smooth slope; otherwise, false if the ceiling is stairs.
+ public bool SlopedCeiling { get { return slopedCeiling; } set { slopedCeiling = value; } }
+
/// The last known extents of the compound brush to detect user resizing the bounds.
private Vector3 m_LastKnownExtents;
/// The last known position of the compound brush to prevent movement on resizing the bounds.
private Vector3 m_LastKnownPosition;
- void Awake()
+ ///
+ /// Gets the beautiful name of the brush used in auto-generation of the hierarchy name.
+ ///
+ /// The beautiful name of the brush.
+ public override string BeautifulBrushName
+ {
+ get
+ {
+ return "Curved Stairs Brush";
+ }
+ }
+
+ protected override void Awake()
{
+ base.Awake();
// get the last known extents and position (especially after scene changes).
m_LastKnownExtents = localBounds.extents;
m_LastKnownPosition = transform.localPosition;
@@ -85,7 +164,7 @@ public override void UpdateVisibility ()
public override void Invalidate (bool polygonsChanged)
{
- base.Invalidate(polygonsChanged);
+ base.Invalidate(polygonsChanged);
////////////////////////////////////////////////////////////////////
// a little hack to detect the user manually resizing the bounds. //
@@ -101,7 +180,7 @@ public override void Invalidate (bool polygonsChanged)
{ //
numSteps += 1; //
m_LastKnownExtents = localBounds.extents; //
- Invalidate(true); // recusion! <3 //
+ Invalidate(true); // recursion! <3 //
return; //
} //
// user is trying to scale down. //
@@ -110,7 +189,7 @@ public override void Invalidate (bool polygonsChanged)
numSteps -= 1; //
if (numSteps < 1) numSteps = 1; //
m_LastKnownExtents = localBounds.extents; //
- Invalidate(true); // recusion! <3 //
+ Invalidate(true); // recursion! <3 //
return; //
} //
} //
@@ -458,6 +537,8 @@ public override void Invalidate (bool polygonsChanged)
localBounds = csgBounds;
m_LastKnownExtents = localBounds.extents;
m_LastKnownPosition = transform.localPosition;
+ // update the generated name in the hierarchy.
+ UpdateGeneratedHierarchyName();
}
///
diff --git a/Scripts/Brushes/CompoundBrushes/Editor/CurvedStairBrushInspector.cs b/Scripts/Brushes/CompoundBrushes/Editor/CurvedStairBrushInspector.cs
index 8a234335..fa6aa862 100644
--- a/Scripts/Brushes/CompoundBrushes/Editor/CurvedStairBrushInspector.cs
+++ b/Scripts/Brushes/CompoundBrushes/Editor/CurvedStairBrushInspector.cs
@@ -40,7 +40,7 @@ protected override void OnEnable()
slopedCeiling = serializedObject.FindProperty("slopedCeiling");
}
- public override void OnInspectorGUI()
+ public override void DoInspectorGUI()
{
bool oldBool;
@@ -143,7 +143,7 @@ public override void OnInspectorGUI()
}
}
- base.OnInspectorGUI();
+ base.DoInspectorGUI();
}
void ApplyAndInvalidate()
diff --git a/Scripts/Brushes/CompoundBrushes/Editor/ShapeEditorBrushInspector.cs b/Scripts/Brushes/CompoundBrushes/Editor/ShapeEditorBrushInspector.cs
index ad0c124a..7ff6a7db 100644
--- a/Scripts/Brushes/CompoundBrushes/Editor/ShapeEditorBrushInspector.cs
+++ b/Scripts/Brushes/CompoundBrushes/Editor/ShapeEditorBrushInspector.cs
@@ -12,7 +12,7 @@ namespace Sabresaurus.SabreCSG
[CustomEditor(typeof(ShapeEditorBrush), true)]
public class ShapeEditorBrushInspector : CompoundBrushInspector
{
- public override void OnInspectorGUI()
+ public override void DoInspectorGUI()
{
using (new NamedVerticalScope("Shape Editor Brush"))
{
@@ -36,7 +36,7 @@ public override void OnInspectorGUI()
GUILayout.EndHorizontal();
}
- base.OnInspectorGUI();
+ base.DoInspectorGUI();
}
}
}
diff --git a/Scripts/Brushes/CompoundBrushes/Editor/ShapeEditorWindow.cs b/Scripts/Brushes/CompoundBrushes/Editor/ShapeEditorWindow.cs
index da4f2fd1..73ea04d8 100644
--- a/Scripts/Brushes/CompoundBrushes/Editor/ShapeEditorWindow.cs
+++ b/Scripts/Brushes/CompoundBrushes/Editor/ShapeEditorWindow.cs
@@ -1,4 +1,5 @@
#if UNITY_EDITOR || RUNTIME_CSG
+
using System;
using System.Collections;
using System.Collections.Generic;
@@ -42,8 +43,31 @@ public class ShapeEditorWindow : EditorWindow
///
private int gridScale = 16;
+ ///
+ /// The mouse position while dragging to calculate relative positioning.
+ ///
private Vector2Int mouseDragLastGridPosition = new Vector2Int();
+ ///
+ /// The mouse drag starting position used for marquee selections.
+ ///
+ private Vector2Int mouseDragStartGridPosition = new Vector2Int();
+
+ ///
+ /// Whether the current drag is a marquee selection box.
+ ///
+ private bool isMarqueeSelect = false;
+
+ ///
+ /// The selected objects before the marquee selection started.
+ ///
+ private List marqueeSelectedObjectsBackup = new List();
+
+ ///
+ /// Whether the current drag is valid (invalid if sliding from the toolbar onto the grid).
+ ///
+ private bool isValidDrag = false;
+
///
/// The currently selected objects.
///
@@ -145,11 +169,11 @@ private Segment GetNextSegment(Segment segment)
}
///
- /// Gets the segment at grid position.
+ /// Gets the object at the specified grid position.
///
/// The x-coordinate on the grid.
/// The y-coordinate on the grid.
- /// The segment if found else null.
+ /// The object if found else null.
private ISelectable GetObjectAtGridPosition(Vector2Int position)
{
// the global pivot point has the highest selection priority.
@@ -165,7 +189,7 @@ private ISelectable GetObjectAtGridPosition(Vector2Int position)
if (segment != null)
return segment.bezierPivot2;
}
- // the segments have the medium-low priority.
+ // the segments have medium-low priority.
foreach (Shape shape in project.shapes)
{
Segment segment = shape.segments.FirstOrDefault((s) => s.position == position);
@@ -182,6 +206,42 @@ private ISelectable GetObjectAtGridPosition(Vector2Int position)
return null;
}
+ ///
+ /// Selects most objects within a marquee rectangle with multi-marquee selection support.
+ ///
+ /// The start grid position of the marquee selection.
+ /// The stop grid position of the marquee selection.
+ private void MarqueeSelectObjectsInRectangle(Vector2Int startPosition, Vector2Int stopPosition)
+ {
+ // calculate a rectangle that always uses positive numbers.
+ int x = stopPosition.x - startPosition.x < 0 ? stopPosition.x : startPosition.x;
+ int y = stopPosition.y - startPosition.y < 0 ? stopPosition.y : startPosition.y;
+ int w = stopPosition.x - startPosition.x < 0 ? startPosition.x - stopPosition.x : stopPosition.x - startPosition.x;
+ int h = stopPosition.y - startPosition.y < 0 ? startPosition.y - stopPosition.y : stopPosition.y - startPosition.y;
+ Rect rect = new Rect(x, y, w, h);
+
+ List results = new List();
+ // the bezier segment pivots have medium-high priority.
+ foreach (Shape shape in project.shapes)
+ {
+ results.AddRange(shape.segments.Where(s => s.type == SegmentType.Bezier && rect.Contains(s.bezierPivot1.position)).Select(s => (ISelectable)s.bezierPivot1));
+ results.AddRange(shape.segments.Where(s => s.type == SegmentType.Bezier && rect.Contains(s.bezierPivot2.position)).Select(s => (ISelectable)s.bezierPivot2));
+ }
+ // the segments have medium-low priority.
+ foreach (Shape shape in project.shapes)
+ {
+ results.AddRange(shape.segments.Where(s => rect.Contains(s.position)).Select(s => (ISelectable)s));
+ }
+ // add all of the previously selected objects.
+ foreach (ISelectable obj in marqueeSelectedObjectsBackup)
+ {
+ if (!results.Contains(obj))
+ results.Add(obj);
+ }
+ // select the objects in the editor.
+ selectedObjects = results;
+ }
+
///
/// Determines whether the global pivot is on the right side or the left side of the project
/// but not inside of any shapes.
@@ -248,9 +308,22 @@ private void OnGUI()
// move object around with the left mouse button.
if (Event.current.button == 0)
{
+ // can't slide from the toolbar onto the grid.
+ if (!isValidDrag) return;
+
Vector2Int grid = ScreenPointToGrid(new Vector3(Event.current.mousePosition.x, Event.current.mousePosition.y));
if (GetViewportRect().Contains(Event.current.mousePosition))
{
+ // if we are drawing a marquee selection:
+ if (isMarqueeSelect)
+ {
+ // select the objects in the current marquee selection.
+ mouseDragLastGridPosition = grid;
+ MarqueeSelectObjectsInRectangle(mouseDragStartGridPosition, mouseDragLastGridPosition);
+ this.Repaint();
+ return; // stop here so we don't move anything.
+ }
+
Vector2Int mouseGridDelta = grid - mouseDragLastGridPosition;
// move the global pivot.
@@ -321,25 +394,56 @@ private void OnGUI()
if (Event.current.type == EventType.MouseDown)
{
- if (Event.current.button == 0 && GetViewportRect().Contains(Event.current.mousePosition))
+ if (Event.current.button == 0)
{
- // if the user is not holding CTRL or SHIFT we clear the selected objects.
- if ((Event.current.modifiers & EventModifiers.Control) == 0 && (Event.current.modifiers & EventModifiers.Shift) == 0)
- selectedObjects.Clear();
+ isValidDrag = false;
- // try finding an object under the mouse cursor.
- Vector2Int grid = ScreenPointToGrid(new Vector3(Event.current.mousePosition.x, Event.current.mousePosition.y));
- ISelectable found = GetObjectAtGridPosition(grid);
- // if the object was already selected, deselect it.
- if (found != null && selectedObjects.Contains(found))
- // deselect the object.
- selectedObjects.Remove(found);
- else if (found != null && !selectedObjects.Contains(found))
- // select the object.
- selectedObjects.Add(found);
- // store the grid position for relative dragging.
- mouseDragLastGridPosition = grid;
- this.Repaint();
+ if (GetViewportRect().Contains(Event.current.mousePosition))
+ {
+ // the user did not click on the toolbar so dragging is valid.
+ isValidDrag = true;
+
+ // if the user is not holding CTRL or SHIFT we clear the selected objects.
+ if ((Event.current.modifiers & EventModifiers.Control) == 0 && (Event.current.modifiers & EventModifiers.Shift) == 0)
+ selectedObjects.Clear();
+
+ // try finding an object under the mouse cursor.
+ Vector2Int grid = ScreenPointToGrid(new Vector3(Event.current.mousePosition.x, Event.current.mousePosition.y));
+ ISelectable found = GetObjectAtGridPosition(grid);
+ // if the object was already selected, deselect it.
+ if (found != null && selectedObjects.Contains(found))
+ // deselect the object.
+ selectedObjects.Remove(found);
+ else if (found != null && !selectedObjects.Contains(found))
+ // select the object.
+ selectedObjects.Add(found);
+ // store the grid position for relative dragging.
+ mouseDragStartGridPosition = grid;
+ mouseDragLastGridPosition = grid;
+ // if nothing was selected or the user is holding CTRL but SHIFT is not held in either case then we start a(nother) marquee selection.
+ if ((selectedObjects.Count == 0 || (Event.current.modifiers & EventModifiers.Control) != 0) && (Event.current.modifiers & EventModifiers.Shift) == 0)
+ {
+ // store a copy of the current selection and start the marquee select.
+ marqueeSelectedObjectsBackup = selectedObjects.ToList();
+ isMarqueeSelect = true;
+ }
+ this.Repaint();
+ }
+ }
+ }
+
+ // have to check the raw type in case the mouse is released outside of this window.
+ if (Event.current.type == EventType.MouseUp || Event.current.rawType == EventType.MouseUp)
+ {
+ // if the left mouse button is released:
+ if (Event.current.button == 0)
+ {
+ // stop the marquee select.
+ if (isMarqueeSelect)
+ {
+ isMarqueeSelect = false;
+ this.Repaint();
+ }
}
}
@@ -490,7 +594,6 @@ private void OnGUI()
// Event.current.Use();
//}
-
if (Event.current.type == EventType.Repaint)
{
if (!initialized)
@@ -613,6 +716,14 @@ private void OnGUI()
// draw the global pivot point.
Vector2 pivotScreenPosition = GridPointToScreen(project.globalPivot.position);
Handles.DrawSolidRectangleWithOutline(new Rect(pivotScreenPosition.x - 4.0f, pivotScreenPosition.y - 4.0f, 8.0f, 8.0f), Color.white, isGlobalPivotSelected ? Color.red : Color.green);
+
+ // draw the current marquee selection.
+ if (isMarqueeSelect)
+ {
+ Vector2 marqueeStart = GridPointToScreen(mouseDragStartGridPosition);
+ Vector2 marqueeStop = GridPointToScreen(mouseDragLastGridPosition);
+ Handles.DrawSolidRectangleWithOutline(new Rect(marqueeStart.x, marqueeStart.y, marqueeStop.x - marqueeStart.x, marqueeStop.y - marqueeStart.y), new Color(0.2f, 0.3f, 0.8f, 0.3f), new Color(0.1f, 0.2f, 0.7f, 0.3f));
+ }
}
GUILayout.BeginHorizontal(EditorStyles.toolbar);
@@ -724,6 +835,8 @@ private void OnGUI()
GenericMenu toolsMenu = new GenericMenu();
toolsMenu.AddItem(new GUIContent("Background/Load Image..."), false, OnToolsBackgroundLoadImage);
toolsMenu.AddItem(new GUIContent("Background/Clear Background"), false, OnToolsBackgroundClearBackground);
+ toolsMenu.AddItem(new GUIContent("Global Pivot/Set Position..."), false, OnToolsPivotSetPosition);
+ toolsMenu.AddItem(new GUIContent("Global Pivot/Reset Position"), false, OnToolsPivotResetPosition);
#if UNITY_5_4_OR_NEWER
toolsMenu.DropDown(new Rect((Screen.width - 50) / EditorGUIUtility.pixelsPerPoint, 0, 0, 16));
#else
@@ -778,8 +891,6 @@ private void RotateSegments(Shape[] shapes, float degrees, Vector2Int pivot)
}
}
-
-
///
/// Called when the new button is pressed. Will reset the shape.
///
@@ -934,9 +1045,9 @@ private void OnZoomIn()
{
switch (gridScale)
{
- case 2 : gridScale = 4 ; break;
- case 4 : gridScale = 8 ; break;
- case 8 : gridScale = 16; break;
+ case 2: gridScale = 4; break;
+ case 4: gridScale = 8; break;
+ case 8: gridScale = 16; break;
case 16: gridScale = 32; break;
case 32: gridScale = 64; break;
case 64: gridScale = 64; break;
@@ -951,10 +1062,10 @@ private void OnZoomOut()
{
switch (gridScale)
{
- case 2 : gridScale = 2 ; break;
- case 4 : gridScale = 2 ; break;
- case 8 : gridScale = 4 ; break;
- case 16: gridScale = 8 ; break;
+ case 2: gridScale = 2; break;
+ case 4: gridScale = 2; break;
+ case 8: gridScale = 4; break;
+ case 16: gridScale = 8; break;
case 32: gridScale = 16; break;
case 64: gridScale = 32; break;
default: gridScale = 16; break;
@@ -967,10 +1078,10 @@ private void OnZoomOut()
private void OnHome()
{
// scroll to the center of the screen.
-#if UNITY_5_4_OR_NEWER
+#if UNITY_2017_2_OR_NEWER
viewportScroll = new Vector2(Screen.safeArea.width / 2.0f / EditorGUIUtility.pixelsPerPoint, Screen.safeArea.height / 2.0f / EditorGUIUtility.pixelsPerPoint);
#else
- viewportScroll = new Vector2(Screen.safeArea.width / 2.0f, Screen.safeArea.height / 2.0f);
+ viewportScroll = new Vector2(Screen.width / 2.0f, Screen.height / 2.0f);
#endif
}
@@ -1112,7 +1223,8 @@ private void OnSegmentBezier()
private void OnSegmentBezierDetail()
{
// let the user choose the amount of bezier curve detail.
- ShowCenteredPopupWindowContent(new ShapeEditorWindowPopup(ShapeEditorWindowPopup.PopupMode.BezierDetailLevel, project, (self) => {
+ ShowCenteredPopupWindowContent(new ShapeEditorWindowPopup(ShapeEditorWindowPopup.PopupMode.BezierDetailLevel, project, (self) =>
+ {
foreach (Shape shape in project.shapes)
{
foreach (Segment segment in shape.segments)
@@ -1144,7 +1256,8 @@ private void OnCreatePolygon(bool popup)
if (popup)
{
// let the user choose the creation parameters.
- ShowCenteredPopupWindowContent(new ShapeEditorWindowPopup(ShapeEditorWindowPopup.PopupMode.CreatePolygon, project, (self) => {
+ ShowCenteredPopupWindowContent(new ShapeEditorWindowPopup(ShapeEditorWindowPopup.PopupMode.CreatePolygon, project, (self) =>
+ {
// create the polygon.
Selection.activeGameObject.GetComponent().CreatePolygon(project);
}));
@@ -1178,20 +1291,13 @@ private void OnRevolveShape(bool popup)
if (popup)
{
// let the user choose the extrude parameters.
- ShowCenteredPopupWindowContent(new ShapeEditorWindowPopup(ShapeEditorWindowPopup.PopupMode.RevolveShape, project, (self) => {
+ ShowCenteredPopupWindowContent(new ShapeEditorWindowPopup(ShapeEditorWindowPopup.PopupMode.RevolveShape, project, (self) =>
+ {
// store generated parameters.
- if (extremeRight)
- {
- project.revolveDirection = true;
- project.revolveRadius = project.globalPivot.position.x - minX;
- project.revolveDistance = minX;
- }
- else
- {
- project.revolveDirection = false;
- project.revolveRadius = maxX - project.globalPivot.position.x;
- project.revolveDistance = maxX;
- }
+ project.revolveRadius = project.globalPivot.position.x - minX;
+ project.revolveDistance = minX;
+ project.revolveDirection = extremeRight;
+
// extrude the shape revolved.
Selection.activeGameObject.GetComponent().RevolveShape(project);
}));
@@ -1199,18 +1305,10 @@ private void OnRevolveShape(bool popup)
else
{
// store generated parameters.
- if (extremeRight)
- {
- project.revolveDirection = true;
- project.revolveRadius = project.globalPivot.position.x - minX;
- project.revolveDistance = minX;
- }
- else
- {
- project.revolveDirection = false;
- project.revolveRadius = maxX - project.globalPivot.position.x;
- project.revolveDistance = maxX;
- }
+ project.revolveRadius = project.globalPivot.position.x - minX;
+ project.revolveDistance = minX;
+ project.revolveDirection = extremeRight;
+
// extrude the shape revolved.
Selection.activeGameObject.GetComponent().RevolveShape(project);
}
@@ -1231,7 +1329,8 @@ private void OnExtrudeShape(bool popup)
if (popup)
{
// let the user choose the extrude parameters.
- ShowCenteredPopupWindowContent(new ShapeEditorWindowPopup(ShapeEditorWindowPopup.PopupMode.ExtrudeShape, project, (self) => {
+ ShowCenteredPopupWindowContent(new ShapeEditorWindowPopup(ShapeEditorWindowPopup.PopupMode.ExtrudeShape, project, (self) =>
+ {
// extrude the shape.
Selection.activeGameObject.GetComponent().ExtrudeShape(project);
}));
@@ -1258,7 +1357,8 @@ private void OnExtrudePoint(bool popup)
if (popup)
{
// let the user choose the extrude parameters.
- ShowCenteredPopupWindowContent(new ShapeEditorWindowPopup(ShapeEditorWindowPopup.PopupMode.ExtrudePoint, project, (self) => {
+ ShowCenteredPopupWindowContent(new ShapeEditorWindowPopup(ShapeEditorWindowPopup.PopupMode.ExtrudePoint, project, (self) =>
+ {
// extrude the shape to a point.
Selection.activeGameObject.GetComponent().ExtrudePoint(project);
}));
@@ -1285,7 +1385,8 @@ private void OnExtrudeBevel(bool popup)
if (popup)
{
// let the user choose the extrude parameters.
- ShowCenteredPopupWindowContent(new ShapeEditorWindowPopup(ShapeEditorWindowPopup.PopupMode.ExtrudeBevel, project, (self) => {
+ ShowCenteredPopupWindowContent(new ShapeEditorWindowPopup(ShapeEditorWindowPopup.PopupMode.ExtrudeBevel, project, (self) =>
+ {
// extrude the shape to a point but capped to cause a trapezoid.
Selection.activeGameObject.GetComponent().ExtrudeBevel(project);
}));
@@ -1325,14 +1426,42 @@ private void OnToolsBackgroundClearBackground()
backgroundImage = null;
}
+ ///
+ /// Called when the tools 'menu/pivot/set position' item is pressed.
+ ///
+ private void OnToolsPivotSetPosition()
+ {
+ // let the user choose the global pivot position.
+ ShowCenteredPopupWindowContent(new ShapeEditorWindowPopup(ShapeEditorWindowPopup.PopupMode.GlobalPivotPosition, project, (self) =>
+ {
+ // set the new global pivot position.
+ project.globalPivot.position = self.GlobalPivotPosition_Position;
+
+ // show the changes.
+ Repaint();
+ }));
+ }
+
+ ///
+ /// Called when the tools 'menu/pivot/reset position' item is pressed.
+ ///
+ private void OnToolsPivotResetPosition()
+ {
+ project.globalPivot.position = Vector2Int.zero;
+ }
+
private Rect GetViewportRect()
{
+#if UNITY_2017_2_OR_NEWER
Rect viewportRect = Screen.safeArea;
+#else
+ Rect viewportRect = new Rect(0, 0, Screen.width, Screen.height);
+#endif
viewportRect.y += 18;
viewportRect.height -= 40;
return viewportRect;
}
-
+
private void GlDrawLine(float thickness, float x1, float y1, float x2, float y2)
{
var point1 = new Vector2(x1, y1);
@@ -1453,11 +1582,15 @@ private Vector2 GridPointToScreen(Vector2Int point)
private void ShowCenteredPopupWindowContent(PopupWindowContent popup)
{
Vector2 size = popup.GetWindowSize();
-#if UNITY_5_4_OR_NEWER
- PopupWindow.Show(new Rect((Screen.safeArea.width / 2.0f / EditorGUIUtility.pixelsPerPoint) - (size.x / 2.0f), (Screen.safeArea.height / 2.0f / EditorGUIUtility.pixelsPerPoint) - (size.y / 2.0f), 0, 0), popup);
+ try
+ {
+#if UNITY_2017_2_OR_NEWER
+ PopupWindow.Show(new Rect((Screen.safeArea.width / 2.0f / EditorGUIUtility.pixelsPerPoint) - (size.x / 2.0f), (Screen.safeArea.height / 2.0f / EditorGUIUtility.pixelsPerPoint) - (size.y / 2.0f), 0, 0), popup);
#else
- PopupWindow.Show(new Rect((Screen.safeArea.width / 2.0f) - (size.x / 2.0f), (Screen.safeArea.height / 2.0f) - (size.y / 2.0f), 0, 0), popup);
+ PopupWindow.Show(new Rect((Screen.width / 2.0f) - (size.x / 2.0f), (Screen.height / 2.0f) - (size.y / 2.0f), 0, 0), popup);
#endif
+ }
+ catch (ExitGUIException) { }
}
///
diff --git a/Scripts/Brushes/CompoundBrushes/Editor/ShapeEditorWindowPopup.cs b/Scripts/Brushes/CompoundBrushes/Editor/ShapeEditorWindowPopup.cs
index 8d18bde5..49db3715 100644
--- a/Scripts/Brushes/CompoundBrushes/Editor/ShapeEditorWindowPopup.cs
+++ b/Scripts/Brushes/CompoundBrushes/Editor/ShapeEditorWindowPopup.cs
@@ -1,4 +1,5 @@
#if UNITY_EDITOR || RUNTIME_CSG
+
using System;
using System.Collections.Generic;
using System.Linq;
@@ -17,11 +18,12 @@ public class ShapeEditorWindowPopup : PopupWindowContent
public enum PopupMode
{
BezierDetailLevel,
+ GlobalPivotPosition,
CreatePolygon,
RevolveShape,
ExtrudeShape,
ExtrudePoint,
- ExtrudeBevel
+ ExtrudeBevel,
}
private PopupMode popupMode;
@@ -32,6 +34,9 @@ public enum PopupMode
public Vector2 extrudeScale = Vector2.one;
public int revolve360 = 8;
public int revolveSteps = 4;
+ public bool revolveSpiralSloped = false;
+ public Vector2Int GlobalPivotPosition_Position;
+ public bool convexBrushes = true;
private Action onApply;
@@ -45,30 +50,43 @@ public ShapeEditorWindowPopup(PopupMode popupMode, ShapeEditor.Project project,
extrudeScale = project.extrudeScale;
revolve360 = project.revolve360;
revolveSteps = project.revolveSteps;
+ revolveSpiralSloped = project.revolveSpiralSloped;
+ convexBrushes = project.convexBrushes;
+ GlobalPivotPosition_Position = project.globalPivot.position;
- this.onApply = (self) => {
-
+ this.onApply = (self) =>
+ {
// store the extrude settings in the project.
switch (popupMode)
{
case PopupMode.CreatePolygon:
project.extrudeScale = extrudeScale;
+ project.convexBrushes = convexBrushes;
break;
+
case PopupMode.RevolveShape:
project.extrudeScale = extrudeScale;
+ project.convexBrushes = convexBrushes;
project.revolve360 = revolve360;
project.revolveSteps = revolveSteps;
+ project.revolveSpiralSloped = revolveSpiralSloped;
break;
+
case PopupMode.ExtrudeShape:
project.extrudeScale = extrudeScale;
+ project.convexBrushes = convexBrushes;
project.extrudeDepth = extrudeDepth;
break;
+
case PopupMode.ExtrudePoint:
project.extrudeScale = extrudeScale;
+ project.convexBrushes = convexBrushes;
project.extrudeDepth = extrudeDepth;
break;
+
case PopupMode.ExtrudeBevel:
project.extrudeScale = extrudeScale;
+ project.convexBrushes = convexBrushes;
project.extrudeDepth = extrudeDepth;
project.extrudeClipDepth = extrudeClipDepth;
break;
@@ -82,20 +100,30 @@ public ShapeEditorWindowPopup(PopupMode popupMode, ShapeEditor.Project project,
public override Vector2 GetWindowSize()
{
+ // + 18 for every element
switch (popupMode)
{
case PopupMode.BezierDetailLevel:
return new Vector2(205, 140);
+
+ case PopupMode.GlobalPivotPosition:
+ return new Vector2(300, 68);
+
case PopupMode.CreatePolygon:
- return new Vector2(300, 50 + 18);
+ return new Vector2(300, 50 + 36);
+
case PopupMode.RevolveShape:
- return new Vector2(300, 86 + 18);
+ return new Vector2(300, 104 + 36);
+
case PopupMode.ExtrudeShape:
- return new Vector2(300, 68 + 18);
+ return new Vector2(300, 68 + 36);
+
case PopupMode.ExtrudePoint:
- return new Vector2(300, 68 + 18);
+ return new Vector2(300, 68 + 36);
+
case PopupMode.ExtrudeBevel:
- return new Vector2(300, 86 + 18);
+ return new Vector2(300, 86 + 36);
+
default:
return new Vector2(300, 150);
}
@@ -104,12 +132,14 @@ public override Vector2 GetWindowSize()
public override void OnGUI(Rect rect)
{
bool hasScale = true;
+ bool hasConvexBrushes = true;
string accept = "";
switch (popupMode)
{
case PopupMode.BezierDetailLevel:
GUILayout.Label("Bezier Detail Level", EditorStyles.boldLabel);
hasScale = false;
+ hasConvexBrushes = false;
accept = "Apply";
GUILayout.BeginHorizontal(EditorStyles.toolbar);
@@ -161,6 +191,23 @@ public override void OnGUI(Rect rect)
if (bezierDetailLevel_Detail > 999) bezierDetailLevel_Detail = 999;
break;
+ case PopupMode.GlobalPivotPosition:
+ GUILayout.Label("Global Pivot Position", EditorStyles.boldLabel);
+ hasScale = false;
+ hasConvexBrushes = false;
+ accept = "Set Position";
+
+#if !UNITY_2017_2_OR_NEWER
+ EditorGUIUtility.wideMode = true;
+ GlobalPivotPosition_Position = Vector2Int.FloorToInt(EditorGUILayout.Vector2Field("Position", GlobalPivotPosition_Position));
+ EditorGUIUtility.wideMode = false;
+#else
+ EditorGUIUtility.wideMode = true;
+ GlobalPivotPosition_Position = EditorGUILayout.Vector2IntField("Position", GlobalPivotPosition_Position);
+ EditorGUIUtility.wideMode = false;
+#endif
+ break;
+
case PopupMode.CreatePolygon:
GUILayout.Label("Create Polygon", EditorStyles.boldLabel);
accept = "Create";
@@ -175,6 +222,8 @@ public override void OnGUI(Rect rect)
revolveSteps = EditorGUILayout.IntField("Steps", revolveSteps);
if (revolveSteps < 1) revolveSteps = 1;
+ revolveSpiralSloped = EditorGUILayout.Toggle("Sloped Spiral", revolveSpiralSloped);
+
// steps can't be more than 360.
if (revolveSteps > revolve360) revolveSteps = revolve360;
break;
@@ -207,6 +256,11 @@ public override void OnGUI(Rect rect)
break;
}
+ if (hasConvexBrushes)
+ {
+ convexBrushes = EditorGUILayout.Toggle("Convex Brushes", convexBrushes);
+ }
+
if (hasScale)
{
EditorGUIUtility.wideMode = true;
diff --git a/Scripts/Brushes/CompoundBrushes/Editor/StairBrushInspector.cs b/Scripts/Brushes/CompoundBrushes/Editor/StairBrushInspector.cs
index 7744cf21..a6ecab80 100644
--- a/Scripts/Brushes/CompoundBrushes/Editor/StairBrushInspector.cs
+++ b/Scripts/Brushes/CompoundBrushes/Editor/StairBrushInspector.cs
@@ -44,7 +44,7 @@ protected override void OnEnable ()
fillToBottom = serializedObject.FindProperty ("fillToBottom");
}
- public override void OnInspectorGUI()
+ public override void DoInspectorGUI()
{
Rect rect = GUILayoutUtility.GetRect(new GUIContent(), GUI.skin.box, GUILayout.ExpandWidth(true), GUILayout.Height(130));
@@ -105,7 +105,7 @@ public override void OnInspectorGUI()
EditorGUILayout.Space();
}
- base.OnInspectorGUI();
+ base.DoInspectorGUI();
}
private void DrawStairPreview(Rect rect)
diff --git a/Scripts/Brushes/CompoundBrushes/Editor/TrimBrushInspector.cs b/Scripts/Brushes/CompoundBrushes/Editor/TrimBrushInspector.cs
index 26236b77..e657be91 100644
--- a/Scripts/Brushes/CompoundBrushes/Editor/TrimBrushInspector.cs
+++ b/Scripts/Brushes/CompoundBrushes/Editor/TrimBrushInspector.cs
@@ -20,7 +20,7 @@ protected override void OnEnable ()
trimSizeProp = serializedObject.FindProperty ("trimSize");
}
- public override void OnInspectorGUI()
+ public override void DoInspectorGUI()
{
using (new NamedVerticalScope("TrimBrush"))
{
@@ -34,7 +34,7 @@ public override void OnInspectorGUI()
EditorGUILayout.Space();
}
- base.OnInspectorGUI();
+ base.DoInspectorGUI();
}
void ApplyAndInvalidate()
diff --git a/Scripts/Brushes/CompoundBrushes/ShapeEditor/Project.cs b/Scripts/Brushes/CompoundBrushes/ShapeEditor/Project.cs
index d5518001..74cff746 100644
--- a/Scripts/Brushes/CompoundBrushes/ShapeEditor/Project.cs
+++ b/Scripts/Brushes/CompoundBrushes/ShapeEditor/Project.cs
@@ -1,4 +1,5 @@
#if UNITY_EDITOR || RUNTIME_CSG
+
using System;
using System.Collections.Generic;
using System.Linq;
@@ -94,6 +95,18 @@ public class Project
[SerializeField]
public bool revolveDirection = true;
+ ///
+ /// Whether the spiral is like stairs or a smooth slope.
+ ///
+ [SerializeField]
+ public bool revolveSpiralSloped = false;
+
+ ///
+ /// Whether the shape uses Convex Decomposition or Concave Shapes.
+ ///
+ [SerializeField]
+ public bool convexBrushes = true;
+
///
/// Clones this project and returns the copy.
///
@@ -105,4 +118,5 @@ public Project Clone()
}
}
}
+
#endif
\ No newline at end of file
diff --git a/Scripts/Brushes/CompoundBrushes/ShapeEditor/ShapeEditorBrush.cs b/Scripts/Brushes/CompoundBrushes/ShapeEditor/ShapeEditorBrush.cs
index 86113e62..0283eb1d 100644
--- a/Scripts/Brushes/CompoundBrushes/ShapeEditor/ShapeEditorBrush.cs
+++ b/Scripts/Brushes/CompoundBrushes/ShapeEditor/ShapeEditorBrush.cs
@@ -1,4 +1,5 @@
#if UNITY_EDITOR || RUNTIME_CSG
+
using Sabresaurus.SabreCSG.ShapeEditor.Decomposition;
using System;
using System.Collections;
@@ -28,18 +29,22 @@ public enum ExtrudeMode
/// Creates a flat polygon in NoCSG mode.
///
CreatePolygon,
+
///
/// Revolves the shapes.
///
RevolveShape,
+
///
/// Extrudes the shapes.
///
ExtrudeShape,
+
///
/// Extrudes the shapes to a point.
///
ExtrudePoint,
+
///
/// Extrudes the shapes bevelled.
///
@@ -48,29 +53,42 @@ public enum ExtrudeMode
/// The 2D Shape Editor Project (latest project used to build this brush).
[SerializeField]
- Project project = JsonUtility.FromJson("{\"version\":1,\"shapes\":[{\"segments\":[{\"_position\":{\"x\":-18,\"y\":-8},\"type\":0,\"bezierPivot1\":{\"_position\":{\"x\":-2,\"y\":-6}},\"bezierPivot2\":{\"_position\":{\"x\":-2,\"y\":-6}},\"bezierDetail\":3},{\"_position\":{\"x\":-14,\"y\":-11},\"type\":0,\"bezierPivot1\":{\"_position\":{\"x\":-2,\"y\":-6}},\"bezierPivot2\":{\"_position\":{\"x\":-2,\"y\":-6}},\"bezierDetail\":3},{\"_position\":{\"x\":-14,\"y\":-13},\"type\":0,\"bezierPivot1\":{\"_position\":{\"x\":-2,\"y\":-6}},\"bezierPivot2\":{\"_position\":{\"x\":-2,\"y\":-6}},\"bezierDetail\":3},{\"_position\":{\"x\":-20,\"y\":-13},\"type\":0,\"bezierPivot1\":{\"_position\":{\"x\":-2,\"y\":-6}},\"bezierPivot2\":{\"_position\":{\"x\":-2,\"y\":-6}},\"bezierDetail\":3},{\"_position\":{\"x\":-10,\"y\":-19},\"type\":0,\"bezierPivot1\":{\"_position\":{\"x\":-2,\"y\":-6}},\"bezierPivot2\":{\"_position\":{\"x\":-2,\"y\":-6}},\"bezierDetail\":3},{\"_position\":{\"x\":-6,\"y\":-19},\"type\":0,\"bezierPivot1\":{\"_position\":{\"x\":-2,\"y\":-6}},\"bezierPivot2\":{\"_position\":{\"x\":-2,\"y\":-6}},\"bezierDetail\":3},{\"_position\":{\"x\":-6,\"y\":-16},\"type\":0,\"bezierPivot1\":{\"_position\":{\"x\":-2,\"y\":-6}},\"bezierPivot2\":{\"_position\":{\"x\":-2,\"y\":-6}},\"bezierDetail\":3},{\"_position\":{\"x\":-3,\"y\":-19},\"type\":0,\"bezierPivot1\":{\"_position\":{\"x\":-2,\"y\":-6}},\"bezierPivot2\":{\"_position\":{\"x\":-2,\"y\":-6}},\"bezierDetail\":3},{\"_position\":{\"x\":6,\"y\":-19},\"type\":0,\"bezierPivot1\":{\"_position\":{\"x\":-2,\"y\":-6}},\"bezierPivot2\":{\"_position\":{\"x\":-2,\"y\":-6}},\"bezierDetail\":3},{\"_position\":{\"x\":9,\"y\":-16},\"type\":0,\"bezierPivot1\":{\"_position\":{\"x\":-2,\"y\":-6}},\"bezierPivot2\":{\"_position\":{\"x\":-2,\"y\":-6}},\"bezierDetail\":3},{\"_position\":{\"x\":11,\"y\":-16},\"type\":0,\"bezierPivot1\":{\"_position\":{\"x\":-2,\"y\":-6}},\"bezierPivot2\":{\"_position\":{\"x\":-2,\"y\":-6}},\"bezierDetail\":3},{\"_position\":{\"x\":14,\"y\":-12},\"type\":0,\"bezierPivot1\":{\"_position\":{\"x\":-2,\"y\":-6}},\"bezierPivot2\":{\"_position\":{\"x\":-2,\"y\":-6}},\"bezierDetail\":3},{\"_position\":{\"x\":14,\"y\":-2},\"type\":0,\"bezierPivot1\":{\"_position\":{\"x\":-2,\"y\":-6}},\"bezierPivot2\":{\"_position\":{\"x\":-2,\"y\":-6}},\"bezierDetail\":3},{\"_position\":{\"x\":10,\"y\":-8},\"type\":0,\"bezierPivot1\":{\"_position\":{\"x\":-2,\"y\":-6}},\"bezierPivot2\":{\"_position\":{\"x\":-2,\"y\":-6}},\"bezierDetail\":3},{\"_position\":{\"x\":9,\"y\":-11},\"type\":0,\"bezierPivot1\":{\"_position\":{\"x\":-2,\"y\":-6}},\"bezierPivot2\":{\"_position\":{\"x\":-2,\"y\":-6}},\"bezierDetail\":3},{\"_position\":{\"x\":5,\"y\":-15},\"type\":0,\"bezierPivot1\":{\"_position\":{\"x\":-2,\"y\":-6}},\"bezierPivot2\":{\"_position\":{\"x\":-2,\"y\":-6}},\"bezierDetail\":3},{\"_position\":{\"x\":-2,\"y\":-16},\"type\":0,\"bezierPivot1\":{\"_position\":{\"x\":-2,\"y\":-6}},\"bezierPivot2\":{\"_position\":{\"x\":-2,\"y\":-6}},\"bezierDetail\":3},{\"_position\":{\"x\":-3,\"y\":-11},\"type\":0,\"bezierPivot1\":{\"_position\":{\"x\":-2,\"y\":-6}},\"bezierPivot2\":{\"_position\":{\"x\":-2,\"y\":-6}},\"bezierDetail\":3},{\"_position\":{\"x\":9,\"y\":-11},\"type\":0,\"bezierPivot1\":{\"_position\":{\"x\":-2,\"y\":-6}},\"bezierPivot2\":{\"_position\":{\"x\":-2,\"y\":-6}},\"bezierDetail\":3},{\"_position\":{\"x\":10,\"y\":-8},\"type\":0,\"bezierPivot1\":{\"_position\":{\"x\":-2,\"y\":-6}},\"bezierPivot2\":{\"_position\":{\"x\":-2,\"y\":-6}},\"bezierDetail\":3},{\"_position\":{\"x\":6,\"y\":-8},\"type\":0,\"bezierPivot1\":{\"_position\":{\"x\":-2,\"y\":-6}},\"bezierPivot2\":{\"_position\":{\"x\":-2,\"y\":-6}},\"bezierDetail\":3},{\"_position\":{\"x\":-2,\"y\":-1},\"type\":0,\"bezierPivot1\":{\"_position\":{\"x\":-2,\"y\":-6}},\"bezierPivot2\":{\"_position\":{\"x\":-2,\"y\":-6}},\"bezierDetail\":3},{\"_position\":{\"x\":-2,\"y\":3},\"type\":0,\"bezierPivot1\":{\"_position\":{\"x\":-2,\"y\":-6}},\"bezierPivot2\":{\"_position\":{\"x\":-2,\"y\":-6}},\"bezierDetail\":3},{\"_position\":{\"x\":5,\"y\":6},\"type\":0,\"bezierPivot1\":{\"_position\":{\"x\":-2,\"y\":-6}},\"bezierPivot2\":{\"_position\":{\"x\":-2,\"y\":-6}},\"bezierDetail\":3},{\"_position\":{\"x\":12,\"y\":6},\"type\":0,\"bezierPivot1\":{\"_position\":{\"x\":-2,\"y\":-6}},\"bezierPivot2\":{\"_position\":{\"x\":-2,\"y\":-6}},\"bezierDetail\":3},{\"_position\":{\"x\":10,\"y\":8},\"type\":0,\"bezierPivot1\":{\"_position\":{\"x\":-2,\"y\":-6}},\"bezierPivot2\":{\"_position\":{\"x\":-2,\"y\":-6}},\"bezierDetail\":3},{\"_position\":{\"x\":-10,\"y\":8},\"type\":0,\"bezierPivot1\":{\"_position\":{\"x\":-2,\"y\":-6}},\"bezierPivot2\":{\"_position\":{\"x\":-2,\"y\":-6}},\"bezierDetail\":3},{\"_position\":{\"x\":-18,\"y\":0},\"type\":0,\"bezierPivot1\":{\"_position\":{\"x\":-2,\"y\":-6}},\"bezierPivot2\":{\"_position\":{\"x\":-2,\"y\":-6}},\"bezierDetail\":3}],\"pivot\":{\"_position\":{\"x\":0,\"y\":-8}}}],\"globalPivot\":{\"_position\":{\"x\":0,\"y\":0}},\"flipHorizontally\":false,\"flipVertically\":false,\"extrudeDepth\":1.0,\"extrudeClipDepth\":0.5,\"extrudeScale\":{\"x\":1.0,\"y\":1.0},\"revolve360\":8,\"revolveSteps\":4,\"revolveDistance\":1,\"revolveRadius\":1,\"revolveDirection\":true}");
+ private Project project = JsonUtility.FromJson("{\"version\":1,\"shapes\":[{\"segments\":[{\"_position\":{\"x\":-18,\"y\":-8},\"type\":0,\"bezierPivot1\":{\"_position\":{\"x\":-2,\"y\":-6}},\"bezierPivot2\":{\"_position\":{\"x\":-2,\"y\":-6}},\"bezierDetail\":3},{\"_position\":{\"x\":-14,\"y\":-11},\"type\":0,\"bezierPivot1\":{\"_position\":{\"x\":-2,\"y\":-6}},\"bezierPivot2\":{\"_position\":{\"x\":-2,\"y\":-6}},\"bezierDetail\":3},{\"_position\":{\"x\":-14,\"y\":-13},\"type\":0,\"bezierPivot1\":{\"_position\":{\"x\":-2,\"y\":-6}},\"bezierPivot2\":{\"_position\":{\"x\":-2,\"y\":-6}},\"bezierDetail\":3},{\"_position\":{\"x\":-20,\"y\":-13},\"type\":0,\"bezierPivot1\":{\"_position\":{\"x\":-2,\"y\":-6}},\"bezierPivot2\":{\"_position\":{\"x\":-2,\"y\":-6}},\"bezierDetail\":3},{\"_position\":{\"x\":-10,\"y\":-19},\"type\":0,\"bezierPivot1\":{\"_position\":{\"x\":-2,\"y\":-6}},\"bezierPivot2\":{\"_position\":{\"x\":-2,\"y\":-6}},\"bezierDetail\":3},{\"_position\":{\"x\":-6,\"y\":-19},\"type\":0,\"bezierPivot1\":{\"_position\":{\"x\":-2,\"y\":-6}},\"bezierPivot2\":{\"_position\":{\"x\":-2,\"y\":-6}},\"bezierDetail\":3},{\"_position\":{\"x\":-6,\"y\":-16},\"type\":0,\"bezierPivot1\":{\"_position\":{\"x\":-2,\"y\":-6}},\"bezierPivot2\":{\"_position\":{\"x\":-2,\"y\":-6}},\"bezierDetail\":3},{\"_position\":{\"x\":-3,\"y\":-19},\"type\":0,\"bezierPivot1\":{\"_position\":{\"x\":-2,\"y\":-6}},\"bezierPivot2\":{\"_position\":{\"x\":-2,\"y\":-6}},\"bezierDetail\":3},{\"_position\":{\"x\":6,\"y\":-19},\"type\":0,\"bezierPivot1\":{\"_position\":{\"x\":-2,\"y\":-6}},\"bezierPivot2\":{\"_position\":{\"x\":-2,\"y\":-6}},\"bezierDetail\":3},{\"_position\":{\"x\":9,\"y\":-16},\"type\":0,\"bezierPivot1\":{\"_position\":{\"x\":-2,\"y\":-6}},\"bezierPivot2\":{\"_position\":{\"x\":-2,\"y\":-6}},\"bezierDetail\":3},{\"_position\":{\"x\":11,\"y\":-16},\"type\":0,\"bezierPivot1\":{\"_position\":{\"x\":-2,\"y\":-6}},\"bezierPivot2\":{\"_position\":{\"x\":-2,\"y\":-6}},\"bezierDetail\":3},{\"_position\":{\"x\":14,\"y\":-12},\"type\":0,\"bezierPivot1\":{\"_position\":{\"x\":-2,\"y\":-6}},\"bezierPivot2\":{\"_position\":{\"x\":-2,\"y\":-6}},\"bezierDetail\":3},{\"_position\":{\"x\":14,\"y\":-2},\"type\":0,\"bezierPivot1\":{\"_position\":{\"x\":-2,\"y\":-6}},\"bezierPivot2\":{\"_position\":{\"x\":-2,\"y\":-6}},\"bezierDetail\":3},{\"_position\":{\"x\":10,\"y\":-8},\"type\":0,\"bezierPivot1\":{\"_position\":{\"x\":-2,\"y\":-6}},\"bezierPivot2\":{\"_position\":{\"x\":-2,\"y\":-6}},\"bezierDetail\":3},{\"_position\":{\"x\":9,\"y\":-11},\"type\":0,\"bezierPivot1\":{\"_position\":{\"x\":-2,\"y\":-6}},\"bezierPivot2\":{\"_position\":{\"x\":-2,\"y\":-6}},\"bezierDetail\":3},{\"_position\":{\"x\":5,\"y\":-15},\"type\":0,\"bezierPivot1\":{\"_position\":{\"x\":-2,\"y\":-6}},\"bezierPivot2\":{\"_position\":{\"x\":-2,\"y\":-6}},\"bezierDetail\":3},{\"_position\":{\"x\":-2,\"y\":-16},\"type\":0,\"bezierPivot1\":{\"_position\":{\"x\":-2,\"y\":-6}},\"bezierPivot2\":{\"_position\":{\"x\":-2,\"y\":-6}},\"bezierDetail\":3},{\"_position\":{\"x\":-3,\"y\":-11},\"type\":0,\"bezierPivot1\":{\"_position\":{\"x\":-2,\"y\":-6}},\"bezierPivot2\":{\"_position\":{\"x\":-2,\"y\":-6}},\"bezierDetail\":3},{\"_position\":{\"x\":9,\"y\":-11},\"type\":0,\"bezierPivot1\":{\"_position\":{\"x\":-2,\"y\":-6}},\"bezierPivot2\":{\"_position\":{\"x\":-2,\"y\":-6}},\"bezierDetail\":3},{\"_position\":{\"x\":10,\"y\":-8},\"type\":0,\"bezierPivot1\":{\"_position\":{\"x\":-2,\"y\":-6}},\"bezierPivot2\":{\"_position\":{\"x\":-2,\"y\":-6}},\"bezierDetail\":3},{\"_position\":{\"x\":6,\"y\":-8},\"type\":0,\"bezierPivot1\":{\"_position\":{\"x\":-2,\"y\":-6}},\"bezierPivot2\":{\"_position\":{\"x\":-2,\"y\":-6}},\"bezierDetail\":3},{\"_position\":{\"x\":-2,\"y\":-1},\"type\":0,\"bezierPivot1\":{\"_position\":{\"x\":-2,\"y\":-6}},\"bezierPivot2\":{\"_position\":{\"x\":-2,\"y\":-6}},\"bezierDetail\":3},{\"_position\":{\"x\":-2,\"y\":3},\"type\":0,\"bezierPivot1\":{\"_position\":{\"x\":-2,\"y\":-6}},\"bezierPivot2\":{\"_position\":{\"x\":-2,\"y\":-6}},\"bezierDetail\":3},{\"_position\":{\"x\":5,\"y\":6},\"type\":0,\"bezierPivot1\":{\"_position\":{\"x\":-2,\"y\":-6}},\"bezierPivot2\":{\"_position\":{\"x\":-2,\"y\":-6}},\"bezierDetail\":3},{\"_position\":{\"x\":12,\"y\":6},\"type\":0,\"bezierPivot1\":{\"_position\":{\"x\":-2,\"y\":-6}},\"bezierPivot2\":{\"_position\":{\"x\":-2,\"y\":-6}},\"bezierDetail\":3},{\"_position\":{\"x\":10,\"y\":8},\"type\":0,\"bezierPivot1\":{\"_position\":{\"x\":-2,\"y\":-6}},\"bezierPivot2\":{\"_position\":{\"x\":-2,\"y\":-6}},\"bezierDetail\":3},{\"_position\":{\"x\":-10,\"y\":8},\"type\":0,\"bezierPivot1\":{\"_position\":{\"x\":-2,\"y\":-6}},\"bezierPivot2\":{\"_position\":{\"x\":-2,\"y\":-6}},\"bezierDetail\":3},{\"_position\":{\"x\":-18,\"y\":0},\"type\":0,\"bezierPivot1\":{\"_position\":{\"x\":-2,\"y\":-6}},\"bezierPivot2\":{\"_position\":{\"x\":-2,\"y\":-6}},\"bezierDetail\":3}],\"pivot\":{\"_position\":{\"x\":0,\"y\":-8}}}],\"globalPivot\":{\"_position\":{\"x\":0,\"y\":0}},\"flipHorizontally\":false,\"flipVertically\":false,\"extrudeDepth\":1.0,\"extrudeClipDepth\":0.5,\"extrudeScale\":{\"x\":1.0,\"y\":1.0},\"revolve360\":8,\"revolveSteps\":4,\"revolveDistance\":1,\"revolveRadius\":1,\"revolveDirection\":true}");
///
/// The extrude mode (latest operation used to build this brush).
///
[SerializeField]
- ExtrudeMode extrudeMode = ExtrudeMode.ExtrudeShape;
+ private ExtrudeMode extrudeMode = ExtrudeMode.ExtrudeShape;
///
/// The last built polygons determine the needed to build the
/// compound brush.
///
[SerializeField]
- int desiredBrushCount;
+ private int desiredBrushCount;
///
/// Whether the geometry has been changed through one of the extrude methods.
///
[SerializeField]
- bool isDirty = true;
+ private bool isDirty = true;
+
+ ///
+ /// Gets the beautiful name of the brush used in auto-generation of the hierarchy name.
+ ///
+ /// The beautiful name of the brush.
+ public override string BeautifulBrushName
+ {
+ get
+ {
+ return "2D Shape Editor Brush";
+ }
+ }
/// The last known extents of the compound brush to detect user resizing the bounds.
private Vector3 m_LastKnownExtents;
+
/// The last known position of the compound brush to prevent movement on resizing the bounds.
private Vector3 m_LastKnownPosition;
@@ -80,8 +98,9 @@ public enum ExtrudeMode
///
private List m_LastBuiltPolygons;
- void Awake()
+ protected override void Awake()
{
+ base.Awake();
// get the last known extents and position (especially after scene changes).
m_LastKnownExtents = localBounds.extents;
m_LastKnownPosition = transform.localPosition;
@@ -91,6 +110,10 @@ public override int BrushCount
{
get
{
+ // if the user desires a single concave brush we return 1.
+ if (!project.convexBrushes)
+ return 1;
+
// we already know the amount of brushes we need.
if (!isDirty)
return desiredBrushCount;
@@ -122,10 +145,22 @@ public override void Invalidate(bool polygonsChanged)
////////////////////////////////////////////////////////////////////
Bounds csgBounds = new Bounds();
+ // force nocsg when creating a flat polygon sheet as sabrecsg doesn't support it.
+ if (extrudeMode == ExtrudeMode.CreatePolygon)
+ this.IsNoCSG = true;
+
+ // force nocsg when revolving with a sloped spiral as there are non-planar polygons.
+ if (extrudeMode == ExtrudeMode.RevolveShape && project.revolveSpiralSloped && project.globalPivot.position.y != 0)
+ this.IsNoCSG = true;
+
+ // force nocsg when using concave brushes as sabrecsg doesn't support it.
+ if (!project.convexBrushes)
+ this.IsNoCSG = true;
+
// nothing to do except copy csg information to our child brushes.
if (!isDirty)
{
- for (int i = 0; i < BrushCount; i++)
+ for (int i = 0; i < (project.convexBrushes ? desiredBrushCount : 1); i++)
{
generatedBrushes[i].Mode = this.Mode;
generatedBrushes[i].IsNoCSG = this.IsNoCSG;
@@ -148,20 +183,22 @@ public override void Invalidate(bool polygonsChanged)
if (m_LastBuiltPolygons == null)
m_LastBuiltPolygons = BuildConvexPolygons();
- // iterate through the brushes we received:
- int brushCount = BrushCount;
+ // prepare a list of polygons for concave brushes.
+ List concavePolygons = null;
+ if (!project.convexBrushes)
+ concavePolygons = new List();
- // force nocsg when creating a flat polygon sheet as sabrecsg doesn't support it.
- if (extrudeMode == ExtrudeMode.CreatePolygon)
- this.IsNoCSG = true;
+ // iterate through the brushes we received:
+ int brushCount = desiredBrushCount;
+ // iterate through the brushes we received:
for (int i = 0; i < brushCount; i++)
{
// copy our csg information to our child brushes.
- generatedBrushes[i].Mode = this.Mode;
- generatedBrushes[i].IsNoCSG = this.IsNoCSG;
- generatedBrushes[i].IsVisible = this.IsVisible;
- generatedBrushes[i].HasCollision = this.HasCollision;
+ generatedBrushes[project.convexBrushes ? i : 0].Mode = this.Mode;
+ generatedBrushes[project.convexBrushes ? i : 0].IsNoCSG = this.IsNoCSG;
+ generatedBrushes[project.convexBrushes ? i : 0].IsVisible = this.IsVisible;
+ generatedBrushes[project.convexBrushes ? i : 0].HasCollision = this.HasCollision;
// local variables.
Quaternion rot;
@@ -175,11 +212,17 @@ public override void Invalidate(bool polygonsChanged)
GenerateUvCoordinates(m_LastBuiltPolygons[i], false);
Polygon poly1 = m_LastBuiltPolygons[i].DeepCopy();
poly1.Flip();
- generatedBrushes[i].SetPolygons(new Polygon[] { poly1 });
+
+ if (project.convexBrushes)
+ generatedBrushes[i].SetPolygons(new Polygon[] { poly1 });
+ else
+ concavePolygons.Add(poly1);
break;
- // generate 3d cube-ish shapes that revolve around the pivot.
+ // generate 3d cube-ish shapes that revolve around the pivot and spirals up or down.
case ExtrudeMode.RevolveShape:
+ float spiralHeight = ((((project.globalPivot.position.y * project.extrudeScale.y) / 8.0f) * (i / m_LastBuiltPolygons.Count)) / project.revolve360) * (project.revolve360 / project.revolveSteps);
+ float spiralStep = ((((project.globalPivot.position.y * project.extrudeScale.y) / 8.0f)) / project.revolve360) * (project.revolve360 / project.revolveSteps);
int labpIndex = i % m_LastBuiltPolygons.Count;
Polygon poly2 = m_LastBuiltPolygons[labpIndex].DeepCopy();
@@ -188,16 +231,17 @@ public override void Invalidate(bool polygonsChanged)
foreach (Vertex v in poly2.Vertices)
{
float step = 360.0f / project.revolve360;
- v.Position = RotatePointAroundPivot(v.Position, new Vector3(((project.revolveDistance / 8.0f) * project.extrudeScale.x) + ((project.revolveRadius * project.extrudeScale.x) / 8.0f), 0.0f, 0.0f), new Vector3(0.0f, (project.revolveDirection ? 0 : 180) + ((i / m_LastBuiltPolygons.Count) * step), 0.0f));
+ v.Position = new Vector3(0, -spiralHeight, 0) + RotatePointAroundPivot(v.Position, new Vector3(((project.revolveDistance / 8.0f) * project.extrudeScale.x) + ((project.revolveRadius * project.extrudeScale.x) / 8.0f), 0.0f, 0.0f), new Vector3(0.0f, ((i / m_LastBuiltPolygons.Count) * step), 0.0f));
}
+ GenerateNormals(poly2);
+
Polygon nextPoly = m_LastBuiltPolygons[labpIndex].DeepCopy();
nextPoly.Flip();
foreach (Vertex v in nextPoly.Vertices)
{
float step = 360.0f / project.revolve360;
- v.Position = RotatePointAroundPivot(v.Position, new Vector3(((project.revolveDistance / 8.0f) * project.extrudeScale.x) + ((project.revolveRadius * project.extrudeScale.x) / 8.0f), 0.0f, 0.0f), new Vector3(0.0f, (project.revolveDirection ? 0 : 180) + (((i / m_LastBuiltPolygons.Count) * step) + step), 0.0f));
+ v.Position = new Vector3(0, -spiralHeight - (project.revolveSpiralSloped ? spiralStep : 0), 0) + RotatePointAroundPivot(v.Position, new Vector3(((project.revolveDistance / 8.0f) * project.extrudeScale.x) + ((project.revolveRadius * project.extrudeScale.x) / 8.0f), 0.0f, 0.0f), new Vector3(0.0f, (((i / m_LastBuiltPolygons.Count) * step) + step), 0.0f));
}
- GenerateNormals(poly2);
List polygons = new List() { poly2 };
List backPolyVertices = new List();
Edge[] myEdges = poly2.GetEdges();
@@ -228,7 +272,10 @@ public override void Invalidate(bool polygonsChanged)
GenerateUvCoordinates(backPoly, false);
polygons.Add(backPoly);
- generatedBrushes[i].SetPolygons(polygons.ToArray());
+ if (project.convexBrushes)
+ generatedBrushes[i].SetPolygons(polygons.ToArray());
+ else
+ concavePolygons.AddRange(polygons);
break;
// generate a 3d cube-ish shape.
@@ -237,7 +284,10 @@ public override void Invalidate(bool polygonsChanged)
SurfaceUtility.ExtrudePolygon(m_LastBuiltPolygons[i], project.extrudeDepth, out outputPolygons, out rot);
foreach (Polygon poly in outputPolygons)
GenerateUvCoordinates(poly, false);
- generatedBrushes[i].SetPolygons(outputPolygons);
+ if (project.convexBrushes)
+ generatedBrushes[i].SetPolygons(outputPolygons);
+ else
+ concavePolygons.AddRange(outputPolygons);
break;
// generate a 3d cone-ish shape.
@@ -246,7 +296,10 @@ public override void Invalidate(bool polygonsChanged)
ExtrudePolygonToPoint(m_LastBuiltPolygons[i], project.extrudeDepth, new Vector2((project.globalPivot.position.x * project.extrudeScale.x) / 8.0f, -(project.globalPivot.position.y * project.extrudeScale.y) / 8.0f), out outputPolygons, out rot);
foreach (Polygon poly in outputPolygons)
GenerateUvCoordinates(poly, false);
- generatedBrushes[i].SetPolygons(outputPolygons);
+ if (project.convexBrushes)
+ generatedBrushes[i].SetPolygons(outputPolygons);
+ else
+ concavePolygons.AddRange(outputPolygons);
break;
// generate a 3d trapezoid-ish shape.
@@ -255,18 +308,106 @@ public override void Invalidate(bool polygonsChanged)
ExtrudePolygonBevel(m_LastBuiltPolygons[i], project.extrudeDepth, project.extrudeClipDepth / project.extrudeDepth, new Vector2((project.globalPivot.position.x * project.extrudeScale.x) / 8.0f, -(project.globalPivot.position.y * project.extrudeScale.y) / 8.0f), out outputPolygons, out rot);
foreach (Polygon poly in outputPolygons)
GenerateUvCoordinates(poly, false);
- generatedBrushes[i].SetPolygons(outputPolygons);
+ if (project.convexBrushes)
+ generatedBrushes[i].SetPolygons(outputPolygons);
+ else
+ concavePolygons.AddRange(outputPolygons);
break;
}
- generatedBrushes[i].Invalidate(true);
- csgBounds.Encapsulate(generatedBrushes[i].GetBounds());
+ // we invalidate every brush after hidden surface removal.
+ }
+
+ // we exclude hidden faces automatically.
+ // this step will automatically optimize NoCSG output the same way additive brushes would have.
+ // it also excludes a couple faces that CSG doesn't exclude due to floating point precision errors.
+ // the latter is especially noticable with complex revolved shapes.
+
+ // hidden surface removal for convex brushes.
+ if (project.convexBrushes)
+ {
+ // compare each brush to another brush:
+ for (int i = 0; i < brushCount; i++)
+ {
+ for (int j = 0; j < brushCount; j++)
+ {
+ // can't check for hidden faces on the same brush.
+ if (i == j) continue;
+
+ // compare each polygon on brush i to each polygon on brush j:
+ foreach (Polygon pa in generatedBrushes[i].GetPolygons())
+ {
+ foreach (Polygon pb in generatedBrushes[j].GetPolygons())
+ {
+ // check they both have this polygon:
+ bool identical = true;
+ foreach (Vertex va in pa.Vertices)
+ {
+ if (!pb.Vertices.Any(vb => vb.Position == va.Position))
+ {
+ identical = false;
+ break;
+ }
+ }
+ // identical polygons on both brushes means it can be excluded:
+ if (identical)
+ {
+ pa.UserExcludeFromFinal = true;
+ pb.UserExcludeFromFinal = true;
+ }
+ }
+ }
+ }
+
+ // invalidate every brush.
+ generatedBrushes[i].Invalidate(true);
+ csgBounds.Encapsulate(generatedBrushes[i].GetBounds());
+ }
+ }
+
+ // hidden surface removal for a concave brush.
+ else
+ {
+ List concavePolygonsCopy = concavePolygons.ToList();
+
+ // compare each polygon and find duplicates:
+ foreach (Polygon pa in concavePolygonsCopy)
+ {
+ foreach (Polygon pb in concavePolygonsCopy)
+ {
+ // can't be the same polygon.
+ if (pa == pb) continue;
+
+ // check they both have this polygon:
+ bool identical = true;
+ foreach (Vertex va in pa.Vertices)
+ {
+ if (!pb.Vertices.Any(vb => vb.Position == va.Position))
+ {
+ identical = false;
+ break;
+ }
+ }
+ // identical polygons on both brushes means it can be excluded:
+ if (identical)
+ {
+ concavePolygons.Remove(pa);
+ concavePolygons.Remove(pb);
+ }
+ }
+ }
+
+ // invalidate the brush.
+ generatedBrushes[0].SetPolygons(concavePolygons.ToArray());
+ csgBounds.Encapsulate(generatedBrushes[0].GetBounds());
}
// apply the generated csg bounds.
localBounds = csgBounds;
m_LastKnownExtents = localBounds.extents;
m_LastKnownPosition = transform.localPosition;
+ // update the generated name in the hierarchy.
+ UpdateGeneratedHierarchyName();
}
///
@@ -284,7 +425,6 @@ private Segment GetNextSegment(Shape parent, Segment segment)
///
/// Builds convex polygons out of the currently loaded 2D Shape Editor project.
- /// Note: Currently simply triangulates everything instead.
///
/// A list of convex polygons.
private List BuildConvexPolygons()
@@ -341,18 +481,22 @@ private List BuildConvexPolygons()
// we make a brush for every polgon.
desiredBrushCount = polygons.Count;
break;
- // we need another brush for every revolve step.
+
case ExtrudeMode.RevolveShape:
+ // we need another brush for every revolve step.
desiredBrushCount = polygons.Count * project.revolveSteps;
break;
+
case ExtrudeMode.ExtrudeShape:
// we make a brush for every polgon.
desiredBrushCount = polygons.Count;
break;
+
case ExtrudeMode.ExtrudePoint:
// we make a brush for every polgon.
desiredBrushCount = polygons.Count;
break;
+
case ExtrudeMode.ExtrudeBevel:
// we make a brush for every polgon.
desiredBrushCount = polygons.Count;
@@ -648,6 +792,30 @@ private Vector3 RotatePointAroundPivot(Vector3 point, Vector3 pivot, Vector3 ang
return Quaternion.Euler(angles) * (point - pivot) + pivot;
}
+ ///
+ /// Flips a project horizontally. This code was stolen from the ShapeEditorWindow.
+ ///
+ private void FlipProjectHorizontally()
+ {
+ // store this flip inside of the project.
+ project.flipHorizontally = !project.flipHorizontally;
+
+ foreach (Shape shape in project.shapes)
+ {
+ foreach (Segment segment in shape.segments)
+ {
+ // flip segment.
+ segment.position = new Vector2Int(-segment.position.x + (project.globalPivot.position.x * 2), segment.position.y);
+ // flip bezier pivot handles.
+ segment.bezierPivot1.position = new Vector2Int(-segment.bezierPivot1.position.x + (project.globalPivot.position.x * 2), segment.bezierPivot1.position.y);
+ segment.bezierPivot2.position = new Vector2Int(-segment.bezierPivot2.position.x + (project.globalPivot.position.x * 2), segment.bezierPivot2.position.y);
+ }
+
+ // recalculate the pivot position of the shape.
+ shape.CalculatePivotPosition();
+ }
+ }
+
///////////////////////////////////////////////////////////////////////////////////////////
// PUBLIC API //
///////////////////////////////////////////////////////////////////////////////////////////
@@ -687,6 +855,8 @@ public void RevolveShape(Project project)
{
// store a project copy inside of this brush.
this.project = project.Clone();
+ // flip project horizontally if revolving left.
+ if (!this.project.revolveDirection) FlipProjectHorizontally();
// store the extrude mode inside of this brush.
extrudeMode = ExtrudeMode.RevolveShape;
// build the polygons out of the project.
@@ -694,6 +864,8 @@ public void RevolveShape(Project project)
// build the brush.
isDirty = true;
Invalidate(true);
+ // un-flip project horizontally if revolving left.
+ if (!this.project.revolveDirection) FlipProjectHorizontally();
}
///
diff --git a/Scripts/Brushes/CompoundBrushes/StairBrush.cs b/Scripts/Brushes/CompoundBrushes/StairBrush.cs
index 61ee9c09..1e7af398 100644
--- a/Scripts/Brushes/CompoundBrushes/StairBrush.cs
+++ b/Scripts/Brushes/CompoundBrushes/StairBrush.cs
@@ -9,31 +9,115 @@ namespace Sabresaurus.SabreCSG
[ExecuteInEditMode]
public class StairBrush : CompoundBrush
{
+ ///
+ /// The depth of each step.
+ ///
[SerializeField]
float stepDepth = 0.2f;
+ ///
+ /// Gets or sets the depth of each step.
+ ///
+ /// The depth of each step.
+ public float StepDepth { get { return stepDepth; } set { stepDepth = value; } }
+
+ ///
+ /// The height of each step.
+ ///
[SerializeField]
float stepHeight = 0.1f;
+ ///
+ /// Gets or sets the height of each step.
+ ///
+ /// The height of each step.
+ public float StepHeight { get { return stepHeight; } set { stepHeight = value; } }
+
+ ///
+ /// The step depth spacing.
+ ///
[SerializeField]
float stepDepthSpacing = 0f;
+ ///
+ /// Gets or sets the step depth spacing.
+ ///
+ /// The step depth spacing.
+ public float StepDepthSpacing { get { return stepDepthSpacing; } set { stepDepthSpacing = value; } }
+
+ ///
+ /// The step height spacing.
+ ///
[SerializeField]
float stepHeightSpacing = 0f;
- [SerializeField]
+ ///
+ /// Gets or sets the step height spacing.
+ ///
+ /// The step height spacing.
+ public float StepHeightSpacing { get { return stepHeightSpacing; } set { stepHeightSpacing = value; } }
+
+ ///
+ /// Whether to automatically determine the best step depth.
+ ///
+ [SerializeField]
bool autoDepth = false;
+ ///
+ /// Gets or sets a value indicating whether to automatically determine the best step depth.
+ ///
+ /// true to automatically determine the best step depth; otherwise, false.
+ public bool AutomaticDepth { get { return autoDepth; } set { autoDepth = value; } }
+
+ ///
+ /// Whether to automatically determine the best step height.
+ ///
[SerializeField]
bool autoHeight = false;
- [SerializeField]
+ ///
+ /// Gets or sets a value indicating whether to automatically determine the best step height.
+ ///
+ /// true to automatically determine the best step height; otherwise, false.
+ public bool AutomaticHeight { get { return autoDepth; } set { autoDepth = value; } }
+
+ ///
+ /// Whether to lead from the top.
+ ///
+ [SerializeField]
bool leadFromTop = false;
+ ///
+ /// Gets or sets a value indicating whether to lead from the top.
+ ///
+ /// true to lead from the top; otherwise, false.
+ public bool LeadFromTop { get { return leadFromTop; } set { leadFromTop = value; } }
+
+ ///
+ /// Whether to fill steps to the bottom to make a solid staircase.
+ ///
[SerializeField]
bool fillToBottom = false;
- public override int BrushCount
+ ///
+ /// Gets or sets a value indicating whether to fill steps to the bottom to make a solid staircase.
+ ///
+ /// true to fill steps to the bottom to make a solid staircase; otherwise, false.
+ public bool FillToBottom { get { return fillToBottom; } set { fillToBottom = value; } }
+
+ ///
+ /// Gets the beautiful name of the brush used in auto-generation of the hierarchy name.
+ ///
+ /// The beautiful name of the brush.
+ public override string BeautifulBrushName
+ {
+ get
+ {
+ return "Linear Stairs Brush";
+ }
+ }
+
+ public override int BrushCount
{
get
{
diff --git a/Scripts/Brushes/CompoundBrushes/TrimBrush.cs b/Scripts/Brushes/CompoundBrushes/TrimBrush.cs
index 09ce1f3d..49f08fff 100644
--- a/Scripts/Brushes/CompoundBrushes/TrimBrush.cs
+++ b/Scripts/Brushes/CompoundBrushes/TrimBrush.cs
@@ -9,11 +9,31 @@ namespace Sabresaurus.SabreCSG
[ExecuteInEditMode]
public class TrimBrush : CompoundBrush
{
-
- [SerializeField]
+ ///
+ /// The size of the trim.
+ ///
+ [SerializeField]
float trimSize = 0.25f;
- public override int BrushCount
+ ///
+ /// Gets or sets the size of the trim.
+ ///
+ /// The size of the trim.
+ public float TrimSize { get { return trimSize; } set { trimSize = value; } }
+
+ ///
+ /// Gets the beautiful name of the brush used in auto-generation of the hierarchy name.
+ ///
+ /// The beautiful name of the brush.
+ public override string BeautifulBrushName
+ {
+ get
+ {
+ return "Trim Brush";
+ }
+ }
+
+ public override int BrushCount
{
get
{
diff --git a/Scripts/Brushes/GroupBrush.cs b/Scripts/Brushes/GroupBrush.cs
new file mode 100644
index 00000000..b9df0fb3
--- /dev/null
+++ b/Scripts/Brushes/GroupBrush.cs
@@ -0,0 +1,272 @@
+#if UNITY_EDITOR || RUNTIME_CSG
+using System;
+using System.Collections;
+using System.Collections.Generic;
+using UnityEngine;
+using System.Reflection;
+using System.Linq;
+
+namespace Sabresaurus.SabreCSG
+{
+ ///
+ /// Brush groups are created when the user wants to group together some brushes.
+ ///
+ [ExecuteInEditMode]
+ public class GroupBrush : BrushBase
+ {
+ [SerializeField]
+ protected Bounds localBounds = new Bounds(Vector3.zero, new Vector3(2, 2, 2));
+
+ ///
+ /// Gets a value indicating whether this brush supports CSG operations. Setting this to false
+ /// will hide CSG brush related options in the editor.
+ /// For example a does not have any CSG operations.
+ ///
+ /// true if this brush supports CSG operations; otherwise, false.
+ public override bool SupportsCsgOperations { get { return false; } }
+
+ ///
+ /// Gets the beautiful name of the brush used in auto-generation of the hierarchy name.
+ ///
+ /// The beautiful name of the brush.
+ public override string BeautifulBrushName
+ {
+ get
+ {
+ return "Group";
+ }
+ }
+
+ /// The last known extents of the compound brush to detect user resizing the bounds.
+ private Vector3 m_LastKnownExtents;
+ /// The last known position of the compound brush to prevent movement on resizing the bounds.
+ private Vector3 m_LastKnownPosition;
+
+ protected override void Awake()
+ {
+ base.Awake();
+ // get the last known extents and position (especially after scene changes).
+ m_LastKnownExtents = localBounds.extents;
+ m_LastKnownPosition = transform.localPosition;
+ }
+
+ public override Bounds GetBounds()
+ {
+ return localBounds;
+ }
+
+ public override Bounds GetBoundsLocalTo(Transform otherTransform)
+ {
+ Vector3[] points = new Vector3[8];
+
+ // Calculate the positions of the bounds corners local to the other transform
+ for (int i = 0; i < 8; i++)
+ {
+ Vector3 point = localBounds.center;
+ Vector3 offset = localBounds.extents;
+
+ if (i % 2 == 0)
+ {
+ offset.x = -offset.x;
+ }
+
+ if (i % 4 < 2)
+ {
+ offset.y = -offset.y;
+ }
+
+ if (i % 8 < 4)
+ {
+ offset.z = -offset.z;
+ }
+
+ point += offset;
+
+ // Transform to world space then to the other transform's local space
+ point = otherTransform.InverseTransformPoint(transform.TransformPoint(point));
+ points[i] = point;
+ }
+
+ // Construct the bounds, starting with the first bounds corner
+ Bounds bounds = new Bounds(points[0], Vector3.zero);
+
+ // Add the rest of the corners to the bounds
+ for (int i = 1; i < 8; i++)
+ {
+ bounds.Encapsulate(points[i]);
+ }
+
+ return bounds;
+ }
+
+ public override Bounds GetBoundsTransformed()
+ {
+ Vector3[] points = new Vector3[8];
+
+ // Calculate the world positions of the bounds corners
+ for (int i = 0; i < 8; i++)
+ {
+ Vector3 point = localBounds.center;
+ Vector3 offset = localBounds.extents;
+
+ if (i % 2 == 0)
+ {
+ offset.x = -offset.x;
+ }
+
+ if (i % 4 < 2)
+ {
+ offset.y = -offset.y;
+ }
+
+ if (i % 8 < 4)
+ {
+ offset.z = -offset.z;
+ }
+
+ point += offset;
+
+ // Transform to world space
+ point = transform.TransformPoint(point);
+ points[i] = point;
+ }
+
+ // Construct the bounds, starting with the first bounds corner
+ Bounds bounds = new Bounds(points[0], Vector3.zero);
+
+ // Add the rest of the corners to the bounds
+ for (int i = 1; i < 8; i++)
+ {
+ bounds.Encapsulate(points[i]);
+ }
+
+ return bounds;
+ }
+
+ public override void OnUndoRedoPerformed()
+ {
+ }
+
+ public override void SetBounds(Bounds newBounds)
+ {
+ localBounds.center = Vector3.zero;
+ localBounds.extents = newBounds.extents;
+
+ transform.Translate(newBounds.center);
+ }
+
+ public override void UpdateVisibility()
+ {
+ }
+
+ public override void Invalidate(bool polygonsChanged)
+ {
+ ////////////////////////////////////////////////////////////////////
+ // a little hack to detect the user manually resizing the bounds. //
+ // it's probably good to build a more 'official' way to detect //
+ // user scaling events in compound brushes sometime. //
+ if (m_LastKnownExtents != localBounds.extents && m_LastKnownPosition != Vector3.zero)
+ { //
+ // undo any position movement. //
+ transform.localPosition = m_LastKnownPosition; //
+ } //
+ ////////////////////////////////////////////////////////////////////
+ Bounds csgBounds = new Bounds();
+
+ // nothing to do except copy csg information to our child brushes.
+ foreach (Transform childTransform in transform)
+ {
+ BrushBase child = childTransform.GetComponent();
+ if (child == null) continue;
+
+ // we do not override these properties in a group.
+ // it wouldn't make much sense and break whatever the user grouped.
+ //child.Mode = this.Mode;
+ //child.IsNoCSG = this.IsNoCSG;
+ //child.IsVisible = this.IsVisible;
+ //child.HasCollision = this.HasCollision;
+ child.Invalidate(polygonsChanged);
+ csgBounds.Encapsulate(child.GetBoundsLocalTo(transform));
+ }
+ // apply the generated csg bounds.
+ localBounds = csgBounds;
+ m_LastKnownExtents = localBounds.extents;
+ m_LastKnownPosition = transform.localPosition;
+ // update name in hierarchy.
+ base.Invalidate(polygonsChanged);
+ }
+
+ protected override void Update()
+ {
+ base.Update();
+ // encapsulate all of the child objects in our bounds.
+ Bounds csgBounds = new Bounds();
+ foreach (Transform childTransform in transform)
+ {
+ BrushBase child = childTransform.GetComponent();
+ if (child == null) continue;
+ csgBounds.Encapsulate(child.GetBoundsLocalTo(transform));
+ }
+ // apply the generated csg bounds.
+ localBounds = csgBounds;
+ // update the generated name in the hierarchy.
+ UpdateGeneratedHierarchyName();
+ }
+
+ ///
+ /// Gets all of the polygons from all brushes in this group brush.
+ ///
+ /// All of the polygons from all brushes in this group brush.
+ public Polygon[] GetPolygons()
+ {
+ List polygons = new List();
+ // iterate through all child brushes:
+ foreach (BrushBase brush in GetComponentsInChildren().Where(c => c.transform != transform))
+ {
+ Polygon[] polys;
+
+ // try getting the polygons depending on the brush type.
+ if (brush is PrimitiveBrush)
+ polys = ((PrimitiveBrush)brush).GetPolygons();
+ else if (brush is CompoundBrush)
+ polys = ((CompoundBrush)brush).GetPolygons();
+ else if (brush is GroupBrush)
+ polys = ((GroupBrush)brush).GetPolygons();
+ else continue;
+
+ polygons.AddRange(GenerateTransformedPolygons(brush.transform, polys));
+ }
+ return polygons.ToArray();
+ }
+
+ ///
+ /// Generates transformed polygons to match the group brush position.
+ ///
+ /// The transform of a child brush.
+ /// The polygons of a child brush.
+ /// The transformed polygons.
+ private Polygon[] GenerateTransformedPolygons(Transform t, Polygon[] polygons)
+ {
+ Polygon[] polygonsCopy = polygons.DeepCopy();
+
+ Vector3 center = t.localPosition;
+ Quaternion rotation = t.localRotation;
+ Vector3 scale = t.lossyScale;
+
+ for (int i = 0; i < polygonsCopy.Length; i++)
+ {
+ for (int j = 0; j < polygonsCopy[i].Vertices.Length; j++)
+ {
+ polygonsCopy[i].Vertices[j].Position = rotation * polygonsCopy[i].Vertices[j].Position.Multiply(scale) + center;
+ polygonsCopy[i].Vertices[j].Normal = rotation * polygonsCopy[i].Vertices[j].Normal;
+ }
+
+ // Just updated a load of vertex positions, so make sure the cached plane is updated
+ polygonsCopy[i].CalculatePlane();
+ }
+
+ return polygonsCopy;
+ }
+ }
+}
+#endif
\ No newline at end of file
diff --git a/Scripts/Brushes/GroupBrush.cs.meta b/Scripts/Brushes/GroupBrush.cs.meta
new file mode 100644
index 00000000..d92ac00b
--- /dev/null
+++ b/Scripts/Brushes/GroupBrush.cs.meta
@@ -0,0 +1,13 @@
+fileFormatVersion: 2
+guid: 3cff19230f770174fb80be4a4fd74062
+timeCreated: 1521045202
+licenseType: Free
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Scripts/Brushes/PrimitiveBrush.cs b/Scripts/Brushes/PrimitiveBrush.cs
index 19dc6a59..f42745d7 100755
--- a/Scripts/Brushes/PrimitiveBrush.cs
+++ b/Scripts/Brushes/PrimitiveBrush.cs
@@ -1,4 +1,5 @@
#if UNITY_EDITOR || RUNTIME_CSG
+
using System;
using System.Collections;
using System.Collections.Generic;
@@ -6,72 +7,121 @@
namespace Sabresaurus.SabreCSG
{
- public enum PrimitiveBrushType {
- Cube,
- Sphere,
- Cylinder,
- Prism,
- Custom,
- IcoSphere,
+ public enum PrimitiveBrushType
+ {
+ Cube,
+ Sphere,
+ Cylinder,
+ Prism,
+ Custom,
+ IcoSphere,
Cone,
- };
+ };
- ///
- /// A simple brush that represents a single convex shape
- ///
+ ///
+ /// A simple brush that represents a single convex shape.
+ ///
[ExecuteInEditMode]
public class PrimitiveBrush : Brush
{
[SerializeField]
- Polygon[] polygons;
+ private Polygon[] polygons;
- [SerializeField,HideInInspector]
- int prismSideCount = 6;
+ ///
+ /// The prism side count.
+ ///
+ [SerializeField, HideInInspector]
+ private int prismSideCount = 6;
- [SerializeField,HideInInspector]
- int cylinderSideCount = 20;
+ ///
+ /// Gets or sets the prism side count.
+ ///
+ /// The prism side count.
+ public int PrismSideCount { get { return prismSideCount; } set { prismSideCount = value; } }
+ ///
+ /// The cylinder side count.
+ ///
[SerializeField, HideInInspector]
- int coneSideCount = 20;
+ private int cylinderSideCount = 20;
- [SerializeField,HideInInspector]
- int sphereSideCount = 6;
+ ///
+ /// Gets or sets the cylinder side count.
+ ///
+ /// The cylinder side count.
+ public int CylinderSideCount { get { return cylinderSideCount; } set { cylinderSideCount = value; } }
- [SerializeField,HideInInspector]
- int icoSphereIterationCount = 1;
+ ///
+ /// The cone side count.
+ ///
+ [SerializeField, HideInInspector]
+ private int coneSideCount = 20;
- [SerializeField,HideInInspector]
- PrimitiveBrushType brushType = PrimitiveBrushType.Cube;
+ ///
+ /// Gets or sets the cone side count.
+ ///
+ /// The cone side count.
+ public int ConeSideCount { get { return coneSideCount; } set { coneSideCount = value; } }
- [SerializeField,HideInInspector]
- bool tracked = false;
+ ///
+ /// The sphere side count.
+ ///
+ [SerializeField, HideInInspector]
+ private int sphereSideCount = 6;
+
+ ///
+ /// Gets or sets the sphere side count.
+ ///
+ /// The sphere side count.
+ public int SphereSideCount { get { return sphereSideCount; } set { sphereSideCount = value; } }
- [SerializeField,HideInInspector]
- BrushOrder cachedBrushOrder = null;
+ ///
+ /// The icon sphere iteration count.
+ ///
+ [SerializeField, HideInInspector]
+ private int icoSphereIterationCount = 1;
- [SerializeField]
- BrushBase brushController = null;
+ ///
+ /// Gets or sets the icon sphere iteration count.
+ ///
+ /// The icon sphere iteration count.
+ public int IcoSphereIterationCount { get { return icoSphereIterationCount; } set { icoSphereIterationCount = value; } }
- int cachedInstanceID = 0;
+ [SerializeField, HideInInspector]
+ private PrimitiveBrushType brushType = PrimitiveBrushType.Cube;
- private CSGModelBase parentCsgModel;
+ [SerializeField, HideInInspector]
+ private bool tracked = false;
- [SerializeField]
- WorldTransformData cachedWorldTransform;
+ [SerializeField, HideInInspector]
+ private BrushOrder cachedBrushOrder = null;
- [SerializeField]
- int objectVersionSerialized;
+ [SerializeField]
+ private BrushBase brushController = null;
- int objectVersionUnserialized;
+ private int cachedInstanceID = 0;
- public PrimitiveBrushType BrushType {
- get {
- return brushType;
- }
- set {
- brushType = value;
- }
- }
+ private CSGModelBase parentCsgModel;
+
+ [SerializeField]
+ private WorldTransformData cachedWorldTransform;
+
+ [SerializeField]
+ private int objectVersionSerialized;
+
+ private int objectVersionUnserialized;
+
+ public PrimitiveBrushType BrushType
+ {
+ get
+ {
+ return brushType;
+ }
+ set
+ {
+ brushType = value;
+ }
+ }
public BrushBase BrushController
{
@@ -83,68 +133,107 @@ public BrushBase BrushController
}
public bool IsReadOnly
- {
- get
- {
- // If this brush is being controlled by something else, it's read only
- return (brushController != null);
- }
- }
+ {
+ get
+ {
+ // If this brush is being controlled by something else, it's read only
+ return (brushController != null);
+ }
+ }
- public void SetBrushController(BrushBase brushController)
- {
- this.brushController = brushController;
- }
+ ///
+ /// Gets the beautiful name of the brush used in auto-generation of the hierarchy name.
+ ///
+ /// The beautiful name of the brush.
+ public override string BeautifulBrushName
+ {
+ get
+ {
+ switch (brushType)
+ {
+ case PrimitiveBrushType.Cube:
+ return "Cube Brush";
+
+ case PrimitiveBrushType.Sphere:
+ return "Sphere Brush";
+
+ case PrimitiveBrushType.Cylinder:
+ return "Cylinder Brush";
+
+ case PrimitiveBrushType.Prism:
+ return "Prism Brush";
+
+ case PrimitiveBrushType.Custom:
+ return "Custom Brush";
+
+ case PrimitiveBrushType.IcoSphere:
+ return "Icosphere Brush";
+
+ case PrimitiveBrushType.Cone:
+ return "Cone Brush";
+
+ default:
+ return base.BeautifulBrushName;
+ }
+ }
+ }
+
+ public void SetBrushController(BrushBase brushController)
+ {
+ this.brushController = brushController;
+ }
- ///
- /// Provide new polygons for the brush
- ///
- /// New polygons.
- /// If the brush type has changed set this to true. For example if you change a cuboid into a wedge, the brush type should no longer be Cube. See BreakTypeRelation() for more details
- public void SetPolygons(Polygon[] polygons, bool breakTypeRelation = true)
+ ///
+ /// Provide new polygons for the brush
+ ///
+ /// New polygons.
+ /// If the brush type has changed set this to true. For example if you change a cuboid into a wedge, the brush type should no longer be Cube. See BreakTypeRelation() for more details
+ public void SetPolygons(Polygon[] polygons, bool breakTypeRelation = true)
{
this.polygons = polygons;
Invalidate(true);
- if(breakTypeRelation)
- {
- BreakTypeRelation();
- }
+ if (breakTypeRelation)
+ {
+ BreakTypeRelation();
+ }
}
- ///
- /// Brushes retain knowledge of what they were made from, so it's easy to adjust the side count on a prism for example, while retaining some of its transform information. If you start cutting away at a prism using the clip tool for instance, it should stop tracking it as following the initial form. This method allows you to tell the brush it is no longer tracking a base form.
- ///
- public void BreakTypeRelation()
- {
- brushType = PrimitiveBrushType.Custom;
- }
+ ///
+ /// Brushes retain knowledge of what they were made from, so it's easy to adjust the side count on a prism for example, while retaining some of its transform information. If you start cutting away at a prism using the clip tool for instance, it should stop tracking it as following the initial form. This method allows you to tell the brush it is no longer tracking a base form.
+ ///
+ public void BreakTypeRelation()
+ {
+ brushType = PrimitiveBrushType.Custom;
+ }
#if UNITY_EDITOR
- [UnityEditor.Callbacks.DidReloadScripts]
- static void OnReloadedScripts()
- {
- PrimitiveBrush[] brushes = FindObjectsOfType();
- for (int i = 0; i < brushes.Length; i++)
- {
- brushes[i].UpdateVisibility();
- }
- }
+ [UnityEditor.Callbacks.DidReloadScripts]
+ private static void OnReloadedScripts()
+ {
+ PrimitiveBrush[] brushes = FindObjectsOfType();
+
+ for (int i = 0; i < brushes.Length; i++)
+ {
+ brushes[i].UpdateVisibility();
+ }
+ }
+
#endif
- void Start()
+ private void Start()
{
- cachedWorldTransform = new WorldTransformData(transform);
- EnsureWellFormed();
+ cachedWorldTransform = new WorldTransformData(transform);
+ EnsureWellFormed();
- Invalidate(false);
+ Invalidate(false);
- if(brushCache == null || brushCache.Polygons == null || brushCache.Polygons.Length == 0)
- {
- RecachePolygons(true);
- }
+ if (brushCache == null || brushCache.Polygons == null || brushCache.Polygons.Length == 0)
+ {
+ RecachePolygons(true);
+ }
#if UNITY_EDITOR
#if UNITY_5_5_OR_NEWER
@@ -156,56 +245,56 @@ void Start()
#endif
#endif
- objectVersionUnserialized = objectVersionSerialized;
+ objectVersionUnserialized = objectVersionSerialized;
}
- ///
- /// Reset the polygons to those specified in the brush type. For example if the brush type is a cube, the polygons are reset to a cube.
- ///
- public void ResetPolygons()
- {
- if (brushType == PrimitiveBrushType.Cube)
- {
- polygons = BrushFactory.GenerateCube();
- }
- else if (brushType == PrimitiveBrushType.Cylinder)
- {
- if(cylinderSideCount < 3)
- {
- cylinderSideCount = 3;
- }
- polygons = BrushFactory.GenerateCylinder(cylinderSideCount);
- }
- else if (brushType == PrimitiveBrushType.Sphere)
- {
- if(sphereSideCount < 3)
- {
- sphereSideCount = 3;
- }
- // Lateral only goes halfway around the sphere (180 deg), longitudinal goes all the way (360 deg)
- polygons = BrushFactory.GeneratePolarSphere(sphereSideCount, sphereSideCount * 2);
- }
- else if (brushType == PrimitiveBrushType.IcoSphere)
- {
- if(icoSphereIterationCount < 0)
- {
- icoSphereIterationCount = 0;
- }
- else if(icoSphereIterationCount > 2)
- {
- icoSphereIterationCount = 2;
- }
-
- polygons = BrushFactory.GenerateIcoSphere(icoSphereIterationCount);
- }
- else if (brushType == PrimitiveBrushType.Prism)
- {
- if(prismSideCount < 3)
- {
- prismSideCount = 3;
- }
- polygons = BrushFactory.GeneratePrism(prismSideCount);
- }
+ ///
+ /// Reset the polygons to those specified in the brush type. For example if the brush type is a cube, the polygons are reset to a cube.
+ ///
+ public void ResetPolygons()
+ {
+ if (brushType == PrimitiveBrushType.Cube)
+ {
+ polygons = BrushFactory.GenerateCube();
+ }
+ else if (brushType == PrimitiveBrushType.Cylinder)
+ {
+ if (cylinderSideCount < 3)
+ {
+ cylinderSideCount = 3;
+ }
+ polygons = BrushFactory.GenerateCylinder(cylinderSideCount);
+ }
+ else if (brushType == PrimitiveBrushType.Sphere)
+ {
+ if (sphereSideCount < 3)
+ {
+ sphereSideCount = 3;
+ }
+ // Lateral only goes halfway around the sphere (180 deg), longitudinal goes all the way (360 deg)
+ polygons = BrushFactory.GeneratePolarSphere(sphereSideCount, sphereSideCount * 2);
+ }
+ else if (brushType == PrimitiveBrushType.IcoSphere)
+ {
+ if (icoSphereIterationCount < 0)
+ {
+ icoSphereIterationCount = 0;
+ }
+ else if (icoSphereIterationCount > 2)
+ {
+ icoSphereIterationCount = 2;
+ }
+
+ polygons = BrushFactory.GenerateIcoSphere(icoSphereIterationCount);
+ }
+ else if (brushType == PrimitiveBrushType.Prism)
+ {
+ if (prismSideCount < 3)
+ {
+ prismSideCount = 3;
+ }
+ polygons = BrushFactory.GeneratePrism(prismSideCount);
+ }
else if (brushType == PrimitiveBrushType.Cone)
{
if (coneSideCount < 3)
@@ -214,358 +303,363 @@ public void ResetPolygons()
}
polygons = BrushFactory.GenerateCone(coneSideCount);
}
- else if(brushType == Sabresaurus.SabreCSG.PrimitiveBrushType.Custom)
- {
- // Do nothing
- Debug.LogError("PrimitiveBrushType.Custom is not a valid type for new brush creation");
- }
- else
- {
- throw new NotImplementedException();
- }
- }
+ else if (brushType == Sabresaurus.SabreCSG.PrimitiveBrushType.Custom)
+ {
+ // Do nothing
+ Debug.LogError("PrimitiveBrushType.Custom is not a valid type for new brush creation");
+ }
+ else
+ {
+ throw new NotImplementedException();
+ }
+ }
- void DrawPolygons(Color color, params Polygon[] polygons)
- {
- GL.Begin(GL.TRIANGLES);
- color.a = 0.7f;
- GL.Color(color);
-
- for (int j = 0; j < polygons.Length; j++)
- {
- Polygon polygon = polygons[j];
- Vector3 position1 = polygon.Vertices[0].Position;
-
- for (int i = 1; i < polygon.Vertices.Length - 1; i++)
- {
- GL.Vertex(transform.TransformPoint(position1));
- GL.Vertex(transform.TransformPoint(polygon.Vertices[i].Position));
- GL.Vertex(transform.TransformPoint(polygon.Vertices[i + 1].Position));
- }
- }
- GL.End();
- }
+ private void DrawPolygons(Color color, params Polygon[] polygons)
+ {
+ GL.Begin(GL.TRIANGLES);
+ color.a = 0.7f;
+ GL.Color(color);
+
+ for (int j = 0; j < polygons.Length; j++)
+ {
+ Polygon polygon = polygons[j];
+ Vector3 position1 = polygon.Vertices[0].Position;
+
+ for (int i = 1; i < polygon.Vertices.Length - 1; i++)
+ {
+ GL.Vertex(transform.TransformPoint(position1));
+ GL.Vertex(transform.TransformPoint(polygon.Vertices[i].Position));
+ GL.Vertex(transform.TransformPoint(polygon.Vertices[i + 1].Position));
+ }
+ }
+ GL.End();
+ }
#if UNITY_EDITOR
+
public void OnRepaint(UnityEditor.SceneView sceneView, Event e)
{
// Selected brush green outline
- if(!isBrushConvex)
- {
- SabreCSGResources.GetSelectedBrushMaterial().SetPass(0);
- DrawPolygons(Color.red, polygons);
- }
+ if (!isBrushConvex)
+ {
+ SabreCSGResources.GetSelectedBrushMaterial().SetPass(0);
+ DrawPolygons(Color.red, polygons);
+ }
}
+
#endif
- public override Polygon[] GenerateTransformedPolygons()
- {
- Polygon[] polygonsCopy = polygons.DeepCopy();
+ public override Polygon[] GenerateTransformedPolygons()
+ {
+ Polygon[] polygonsCopy = polygons.DeepCopy();
- Vector3 center = transform.position;
- Quaternion rotation = transform.rotation;
- Vector3 scale = transform.localScale;
+ Vector3 center = transform.position;
+ Quaternion rotation = transform.rotation;
+ Vector3 scale = transform.lossyScale;
- for (int i = 0; i < polygons.Length; i++)
- {
- for (int j = 0; j < polygons[i].Vertices.Length; j++)
- {
- polygonsCopy[i].Vertices[j].Position = rotation * polygonsCopy[i].Vertices[j].Position.Multiply(scale) + center;
- polygonsCopy[i].Vertices[j].Normal = rotation * polygonsCopy[i].Vertices[j].Normal;
- }
-
- // Just updated a load of vertex positions, so make sure the cached plane is updated
- polygonsCopy[i].CalculatePlane();
- }
+ for (int i = 0; i < polygons.Length; i++)
+ {
+ for (int j = 0; j < polygons[i].Vertices.Length; j++)
+ {
+ polygonsCopy[i].Vertices[j].Position = rotation * polygonsCopy[i].Vertices[j].Position.Multiply(scale) + center;
+ polygonsCopy[i].Vertices[j].Normal = rotation * polygonsCopy[i].Vertices[j].Normal;
+ }
- return polygonsCopy;
- }
+ // Just updated a load of vertex positions, so make sure the cached plane is updated
+ polygonsCopy[i].CalculatePlane();
+ }
- public override void RecalculateBrushCache ()
- {
- RecachePolygons(true);
+ return polygonsCopy;
+ }
- RecalculateIntersections();
- }
+ public override void RecalculateBrushCache()
+ {
+ RecachePolygons(true);
- public override void RecachePolygons(bool markUnbuilt)
- {
- if(brushCache == null)
- {
- brushCache = new BrushCache();
- }
- Polygon[] cachedTransformedPolygons = GenerateTransformedPolygons();
- Bounds cachedTransformedBounds = GetBoundsTransformed();
- brushCache.Set(mode, cachedTransformedPolygons, cachedTransformedBounds, markUnbuilt);
- }
+ RecalculateIntersections();
+ }
- public override void RecalculateIntersections()
- {
- CSGModelBase csgModel = GetCSGModel();
- if(csgModel != null)
- {
- List brushes = GetCSGModel().GetBrushes();
-
- // Tracked brushes at edit time can be added in any order, so sort them
- IComparer comparer = new BrushOrderComparer();
- for (int i = 0; i < brushes.Count; i++)
- {
- if(brushes[i] == null)
- {
- brushes.RemoveAt(i);
- i--;
- }
- }
-
- for (int i = 0; i < brushes.Count; i++)
- {
- brushes[i].UpdateCachedBrushOrder();
- }
-
- brushes.Sort(comparer);
-
- RecalculateIntersections(brushes, true);
- }
- }
+ public override void RecachePolygons(bool markUnbuilt)
+ {
+ if (brushCache == null)
+ {
+ brushCache = new BrushCache();
+ }
+ Polygon[] cachedTransformedPolygons = GenerateTransformedPolygons();
+ Bounds cachedTransformedBounds = GetBoundsTransformed();
+ brushCache.Set(mode, cachedTransformedPolygons, cachedTransformedBounds, markUnbuilt);
+ }
- public override void RecalculateIntersections(List brushes, bool isRootChange)
- {
- List previousVisualIntersections = brushCache.IntersectingVisualBrushes;
- List previousCollisionIntersections = brushCache.IntersectingCollisionBrushes;
+ public override void RecalculateIntersections()
+ {
+ CSGModelBase csgModel = GetCSGModel();
+ if (csgModel != null)
+ {
+ List brushes = GetCSGModel().GetBrushes();
- List intersectingVisualBrushes = CalculateIntersectingBrushes(this, brushes, false);
- List intersectingCollisionBrushes = CalculateIntersectingBrushes(this, brushes, true);
+ // Tracked brushes at edit time can be added in any order, so sort them
+ IComparer comparer = new BrushOrderComparer();
+ for (int i = 0; i < brushes.Count; i++)
+ {
+ if (brushes[i] == null)
+ {
+ brushes.RemoveAt(i);
+ i--;
+ }
+ }
- brushCache.SetIntersection(intersectingVisualBrushes, intersectingCollisionBrushes);
+ for (int i = 0; i < brushes.Count; i++)
+ {
+ brushes[i].UpdateCachedBrushOrder();
+ }
- if(isRootChange)
- {
- // Brushes that are either newly intersecting or no longer intersecting, they need to recalculate their
- // intersections, but also rebuild
- List brushesToRecalcAndRebuild = new List();
-
- // Brushes that are still intersecting, these should recalculate their intersections any way in case
- // sibling order has changed to make sure their intersection order is still correct
- List brushesToRecalculateOnly = new List();
-
- // Brushes that are either new or existing intersections
- for (int i = 0; i < intersectingVisualBrushes.Count; i++)
- {
- if(intersectingVisualBrushes[i] != null)
- {
- if(!previousVisualIntersections.Contains(intersectingVisualBrushes[i]))
- {
- // It's a newly intersecting brush
- if(!brushesToRecalcAndRebuild.Contains(intersectingVisualBrushes[i]))
- {
- brushesToRecalcAndRebuild.Add(intersectingVisualBrushes[i]);
- }
- }
- else
- {
- // Intersection was already present
- if(!brushesToRecalculateOnly.Contains(intersectingVisualBrushes[i]))
- {
- brushesToRecalculateOnly.Add(intersectingVisualBrushes[i]);
- }
- }
- }
- }
-
- // Find any brushes that no longer intersect
- for (int i = 0; i < previousVisualIntersections.Count; i++)
- {
- if(previousVisualIntersections[i] != null && !intersectingVisualBrushes.Contains(previousVisualIntersections[i]))
- {
- if(!brushesToRecalcAndRebuild.Contains(previousVisualIntersections[i]))
- {
- brushesToRecalcAndRebuild.Add(previousVisualIntersections[i]);
- }
- }
- }
-
- // Collision Pass
-
- // Brushes that are either new or existing intersections
- for (int i = 0; i < intersectingCollisionBrushes.Count; i++)
- {
- if(intersectingCollisionBrushes[i] != null)
- {
- if(!previousCollisionIntersections.Contains(intersectingCollisionBrushes[i]))
- {
- // It's a newly intersecting brush
- if(!brushesToRecalcAndRebuild.Contains(intersectingCollisionBrushes[i]))
- {
- brushesToRecalcAndRebuild.Add(intersectingCollisionBrushes[i]);
- }
- }
- else
- {
- // Intersection was already present
- if(!brushesToRecalculateOnly.Contains(intersectingCollisionBrushes[i]))
- {
- brushesToRecalculateOnly.Add(intersectingCollisionBrushes[i]);
- }
- }
- }
- }
-
- // Find any brushes that no longer intersect
- for (int i = 0; i < previousCollisionIntersections.Count; i++)
- {
- if(previousCollisionIntersections[i] != null && !intersectingCollisionBrushes.Contains(previousCollisionIntersections[i]))
- {
- if(!brushesToRecalcAndRebuild.Contains(previousCollisionIntersections[i]))
- {
- brushesToRecalcAndRebuild.Add(previousCollisionIntersections[i]);
- }
- }
- }
-
- // Notify brushes that are either newly intersecting or no longer intersecting that they need to recalculate and rebuild
- for (int i = 0; i < brushesToRecalcAndRebuild.Count; i++)
- {
- // Brush intersection has changed
- brushesToRecalcAndRebuild[i].RecalculateIntersections(brushes, false);
- // Brush needs to be built
- brushesToRecalcAndRebuild[i].BrushCache.SetUnbuilt();
- }
-
- // Brushes that remain intersecting should recalc their intersection lists just in case sibling order has changed
- for (int i = 0; i < brushesToRecalculateOnly.Count; i++)
- {
- // Brush intersection has changed
- brushesToRecalculateOnly[i].RecalculateIntersections(brushes, false);
- }
- }
- }
+ brushes.Sort(comparer);
+
+ RecalculateIntersections(brushes, true);
+ }
+ }
+
+ public override void RecalculateIntersections(List brushes, bool isRootChange)
+ {
+ List previousVisualIntersections = brushCache.IntersectingVisualBrushes;
+ List previousCollisionIntersections = brushCache.IntersectingCollisionBrushes;
+
+ List intersectingVisualBrushes = CalculateIntersectingBrushes(this, brushes, false);
+ List intersectingCollisionBrushes = CalculateIntersectingBrushes(this, brushes, true);
+
+ brushCache.SetIntersection(intersectingVisualBrushes, intersectingCollisionBrushes);
+
+ if (isRootChange)
+ {
+ // Brushes that are either newly intersecting or no longer intersecting, they need to recalculate their
+ // intersections, but also rebuild
+ List brushesToRecalcAndRebuild = new List();
+
+ // Brushes that are still intersecting, these should recalculate their intersections any way in case
+ // sibling order has changed to make sure their intersection order is still correct
+ List brushesToRecalculateOnly = new List();
+
+ // Brushes that are either new or existing intersections
+ for (int i = 0; i < intersectingVisualBrushes.Count; i++)
+ {
+ if (intersectingVisualBrushes[i] != null)
+ {
+ if (!previousVisualIntersections.Contains(intersectingVisualBrushes[i]))
+ {
+ // It's a newly intersecting brush
+ if (!brushesToRecalcAndRebuild.Contains(intersectingVisualBrushes[i]))
+ {
+ brushesToRecalcAndRebuild.Add(intersectingVisualBrushes[i]);
+ }
+ }
+ else
+ {
+ // Intersection was already present
+ if (!brushesToRecalculateOnly.Contains(intersectingVisualBrushes[i]))
+ {
+ brushesToRecalculateOnly.Add(intersectingVisualBrushes[i]);
+ }
+ }
+ }
+ }
+
+ // Find any brushes that no longer intersect
+ for (int i = 0; i < previousVisualIntersections.Count; i++)
+ {
+ if (previousVisualIntersections[i] != null && !intersectingVisualBrushes.Contains(previousVisualIntersections[i]))
+ {
+ if (!brushesToRecalcAndRebuild.Contains(previousVisualIntersections[i]))
+ {
+ brushesToRecalcAndRebuild.Add(previousVisualIntersections[i]);
+ }
+ }
+ }
+ // Collision Pass
- // Fired by the CSG Model
+ // Brushes that are either new or existing intersections
+ for (int i = 0; i < intersectingCollisionBrushes.Count; i++)
+ {
+ if (intersectingCollisionBrushes[i] != null)
+ {
+ if (!previousCollisionIntersections.Contains(intersectingCollisionBrushes[i]))
+ {
+ // It's a newly intersecting brush
+ if (!brushesToRecalcAndRebuild.Contains(intersectingCollisionBrushes[i]))
+ {
+ brushesToRecalcAndRebuild.Add(intersectingCollisionBrushes[i]);
+ }
+ }
+ else
+ {
+ // Intersection was already present
+ if (!brushesToRecalculateOnly.Contains(intersectingCollisionBrushes[i]))
+ {
+ brushesToRecalculateOnly.Add(intersectingCollisionBrushes[i]);
+ }
+ }
+ }
+ }
+
+ // Find any brushes that no longer intersect
+ for (int i = 0; i < previousCollisionIntersections.Count; i++)
+ {
+ if (previousCollisionIntersections[i] != null && !intersectingCollisionBrushes.Contains(previousCollisionIntersections[i]))
+ {
+ if (!brushesToRecalcAndRebuild.Contains(previousCollisionIntersections[i]))
+ {
+ brushesToRecalcAndRebuild.Add(previousCollisionIntersections[i]);
+ }
+ }
+ }
+
+ // Notify brushes that are either newly intersecting or no longer intersecting that they need to recalculate and rebuild
+ for (int i = 0; i < brushesToRecalcAndRebuild.Count; i++)
+ {
+ // Brush intersection has changed
+ brushesToRecalcAndRebuild[i].RecalculateIntersections(brushes, false);
+ // Brush needs to be built
+ brushesToRecalcAndRebuild[i].BrushCache.SetUnbuilt();
+ }
+
+ // Brushes that remain intersecting should recalc their intersection lists just in case sibling order has changed
+ for (int i = 0; i < brushesToRecalculateOnly.Count; i++)
+ {
+ // Brush intersection has changed
+ brushesToRecalculateOnly[i].RecalculateIntersections(brushes, false);
+ }
+ }
+ }
+
+ // Fired by the CSG Model
public override void OnUndoRedoPerformed()
- {
- if(objectVersionSerialized != objectVersionUnserialized)
- {
- Invalidate(true);
- }
+ {
+ if (objectVersionSerialized != objectVersionUnserialized)
+ {
+ Invalidate(true);
+ }
}
- void EnsureWellFormed()
+ private void EnsureWellFormed()
{
if (polygons == null || polygons.Length == 0)
{
- // Reset custom brushes back to a cube
- if(brushType == PrimitiveBrushType.Custom)
- {
- brushType = PrimitiveBrushType.Cube;
- }
-
- ResetPolygons();
- }
- }
-
-// public void OnDrawGizmosSelected()
-// {
-// // Ensure Edit Mode is on
-// GetCSGModel().EditMode = true;
-// }
-//
-// public void OnDrawGizmos()
-// {
-// EnsureWellFormed();
-//
-// // Gizmos.color = Color.green;
-// // for (int i = 0; i < PolygonFactory.hackyDisplay1.Count; i++)
-// // {
-// // Gizmos.DrawSphere(PolygonFactory.hackyDisplay1[i], 0.2f);
-// // }
-// //
-// // Gizmos.color = Color.red;
-// // for (int i = 0; i < PolygonFactory.hackyDisplay2.Count; i++)
-// // {
-// // Gizmos.DrawSphere(PolygonFactory.hackyDisplay2[i], 0.2f);
-// // }
-// }
-
-
- void OnDisable()
- {
- // OnDisable is called on recompilation, so make sure we only process when needed
- if(this.enabled == false || (gameObject.activeInHierarchy == false && transform.root.gameObject.activeInHierarchy == true))
- {
- GetCSGModel().OnBrushDisabled(this);
- // Copy the intersections list since the source list will change as we call recalculate on other brushes
- List intersectingVisualBrushes = new List(brushCache.IntersectingVisualBrushes);
-
- for (int i = 0; i < intersectingVisualBrushes.Count; i++)
- {
- if(intersectingVisualBrushes[i] != null)
- {
- intersectingVisualBrushes[i].RecalculateIntersections();
- intersectingVisualBrushes[i].BrushCache.SetUnbuilt();
- }
- }
- }
- }
+ // Reset custom brushes back to a cube
+ if (brushType == PrimitiveBrushType.Custom)
+ {
+ brushType = PrimitiveBrushType.Cube;
+ }
- void UpdateTracking()
- {
- CSGModelBase parentCSGModel = GetCSGModel();
+ ResetPolygons();
+ }
+ }
- // Make sure the CSG Model knows about this brush. If they duplicated a brush in the hierarchy then this
- // allows us to make sure the CSG Model knows about it
- if(parentCSGModel != null)
- {
- bool newBrush = parentCSGModel.TrackBrush(this);
-
- if(newBrush)
- {
- MeshFilter meshFilter = gameObject.AddOrGetComponent();
-
- meshFilter.sharedMesh = new Mesh();
- brushCache = new BrushCache();
- EnsureWellFormed();
- RecalculateBrushCache();
- }
- Invalidate(false);
- tracked = true;
- }
- else
- {
- tracked = false;
- }
- }
+ // public void OnDrawGizmosSelected()
+ // {
+ // // Ensure Edit Mode is on
+ // GetCSGModel().EditMode = true;
+ // }
+ //
+ // public void OnDrawGizmos()
+ // {
+ // EnsureWellFormed();
+ //
+ // // Gizmos.color = Color.green;
+ // // for (int i = 0; i < PolygonFactory.hackyDisplay1.Count; i++)
+ // // {
+ // // Gizmos.DrawSphere(PolygonFactory.hackyDisplay1[i], 0.2f);
+ // // }
+ // //
+ // // Gizmos.color = Color.red;
+ // // for (int i = 0; i < PolygonFactory.hackyDisplay2.Count; i++)
+ // // {
+ // // Gizmos.DrawSphere(PolygonFactory.hackyDisplay2[i], 0.2f);
+ // // }
+ // }
+
+ private void OnDisable()
+ {
+ // OnDisable is called on recompilation, so make sure we only process when needed
+ if (this.enabled == false || (gameObject.activeInHierarchy == false && transform.root.gameObject.activeInHierarchy == true))
+ {
+ GetCSGModel().OnBrushDisabled(this);
+ // Copy the intersections list since the source list will change as we call recalculate on other brushes
+ List intersectingVisualBrushes = new List(brushCache.IntersectingVisualBrushes);
- void OnEnable()
- {
- UpdateTracking();
- }
+ for (int i = 0; i < intersectingVisualBrushes.Count; i++)
+ {
+ if (intersectingVisualBrushes[i] != null)
+ {
+ intersectingVisualBrushes[i].RecalculateIntersections();
+ intersectingVisualBrushes[i].BrushCache.SetUnbuilt();
+ }
+ }
+ }
+ }
- void Update()
- {
- if(!tracked)
- {
- UpdateTracking();
- }
+ private void UpdateTracking()
+ {
+ CSGModelBase parentCSGModel = GetCSGModel();
- // If the transform has changed, needs rebuild
- if(cachedWorldTransform.SetFromTransform(transform))
- {
- Invalidate(true);
- }
- }
+ // Make sure the CSG Model knows about this brush. If they duplicated a brush in the hierarchy then this
+ // allows us to make sure the CSG Model knows about it
+ if (parentCSGModel != null)
+ {
+ // don't track brushes while a large scene update is going on.
+ if (parentCsgModel.IsUpdating) return;
+
+ bool newBrush = parentCSGModel.TrackBrush(this);
+
+ if (newBrush)
+ {
+ MeshFilter meshFilter = gameObject.AddOrGetComponent();
+
+ meshFilter.sharedMesh = new Mesh();
+ brushCache = new BrushCache();
+ EnsureWellFormed();
+ RecalculateBrushCache();
+ }
+ Invalidate(false);
+ tracked = true;
+ }
+ else
+ {
+ tracked = false;
+ }
+ }
+
+ private void OnEnable()
+ {
+ UpdateTracking();
+ }
+
+ protected override void Update()
+ {
+ base.Update();
+
+ if (!tracked)
+ {
+ UpdateTracking();
+ }
- ///
- /// Tells the brush it has changed
- ///
- /// If set to true polygons will be recached.
+ // If the transform has changed, needs rebuild
+ if (cachedWorldTransform.SetFromTransform(transform))
+ {
+ Invalidate(true);
+ }
+ }
+
+ ///
+ /// Tells the brush it has changed
+ ///
+ /// If set to true polygons will be recached.
public override void Invalidate(bool polygonsChanged)
{
- base.Invalidate(polygonsChanged);
- if(!gameObject.activeInHierarchy)
- {
- return;
- }
+ base.Invalidate(polygonsChanged);
+ if (!gameObject.activeInHierarchy)
+ {
+ return;
+ }
// previous versions of sabrecsg used to use mesh colliders for ray collision, but that's no longer the case so we clean them up.
MeshCollider[] meshColliders = GetComponents();
@@ -573,7 +667,6 @@ public override void Invalidate(bool polygonsChanged)
for (int i = 0; i < meshColliders.Length; i++)
DestroyImmediate(meshColliders[i]);
-
// Make sure there is a mesh filter on this object
MeshFilter meshFilter = gameObject.AddOrGetComponent();
MeshRenderer meshRenderer = gameObject.AddOrGetComponent();
@@ -597,17 +690,16 @@ public override void Invalidate(bool polygonsChanged)
if (polygons != null)
{
- List polygonIndices;
- BrushFactory.GenerateMeshFromPolygons(polygons, ref renderMesh, out polygonIndices);
+ // generate a mesh preview for the transparent brushes.
+ // we also displace the triangles along the normals slightly so we can overlay built geometry
+ // with semi-transparent geometry and avoid depth fighting.
+ BrushFactory.GenerateMeshFromPolygonsFast(polygons, ref renderMesh, mode == CSGMode.Add ? 0.001f : -0.001f);
}
if (mode == CSGMode.Subtract)
{
MeshHelper.Invert(ref renderMesh);
}
- // Displace the triangles for display along the normals very slightly (this is so we can overlay built
- // geometry with semi-transparent geometry and avoid depth fighting)
- MeshHelper.Displace(ref renderMesh, 0.001f);
meshFilter.sharedMesh = renderMesh;
@@ -639,34 +731,34 @@ public override void Invalidate(bool polygonsChanged)
meshRenderer.sharedMaterial = material;
}
#endif
-// isBrushConvex = GeometryHelper.IsBrushConvex(polygons);
+ // isBrushConvex = GeometryHelper.IsBrushConvex(polygons);
- if(polygonsChanged)
- {
- RecalculateBrushCache();
- }
+ if (polygonsChanged)
+ {
+ RecalculateBrushCache();
+ }
- UpdateVisibility();
+ UpdateVisibility();
- objectVersionSerialized++;
- objectVersionUnserialized = objectVersionSerialized;
+ objectVersionSerialized++;
+ objectVersionUnserialized = objectVersionSerialized;
- if(cachedWorldTransform == null)
- {
- cachedWorldTransform = new WorldTransformData(transform);
- }
- cachedWorldTransform.SetFromTransform(transform);
+ if (cachedWorldTransform == null)
+ {
+ cachedWorldTransform = new WorldTransformData(transform);
+ }
+ cachedWorldTransform.SetFromTransform(transform);
}
- public override void UpdateVisibility()
+ public override void UpdateVisibility()
{
- // Display brush if the CSG Model says to or if the brush isn't under a CSG Model
- CSGModelBase csgModel = GetCSGModel();
- bool isVisible = false;
- if(csgModel == null || csgModel.AreBrushesVisible)
- {
- isVisible = true;
- }
+ // Display brush if the CSG Model says to or if the brush isn't under a CSG Model
+ CSGModelBase csgModel = GetCSGModel();
+ bool isVisible = false;
+ if (csgModel == null || csgModel.AreBrushesVisible)
+ {
+ isVisible = true;
+ }
MeshRenderer meshRenderer = GetComponent();
if (meshRenderer != null)
{
@@ -674,58 +766,58 @@ public override void UpdateVisibility()
}
}
-// public Polygon GetPolygonFromTriangle(int triangleIndex)
-// {
-// int polygonIndex = polygonIndices[triangleIndex];
-// return polygons[polygonIndex];
-// }
+ // public Polygon GetPolygonFromTriangle(int triangleIndex)
+ // {
+ // int polygonIndex = polygonIndices[triangleIndex];
+ // return polygons[polygonIndex];
+ // }
public override Bounds GetBounds()
{
- if (polygons.Length > 0)
- {
- Bounds bounds = new Bounds(polygons[0].Vertices[0].Position, Vector3.zero);
-
- for (int i = 0; i < polygons.Length; i++)
- {
- for (int j = 0; j < polygons[i].Vertices.Length; j++)
- {
- bounds.Encapsulate(polygons[i].Vertices[j].Position);
- }
- }
- return bounds;
- }
- else
- {
- return new Bounds(Vector3.zero, Vector3.zero);
- }
+ if (polygons != null && polygons.Length > 0)
+ {
+ Bounds bounds = new Bounds(polygons[0].Vertices[0].Position, Vector3.zero);
+
+ for (int i = 0; i < polygons.Length; i++)
+ {
+ for (int j = 0; j < polygons[i].Vertices.Length; j++)
+ {
+ bounds.Encapsulate(polygons[i].Vertices[j].Position);
+ }
+ }
+ return bounds;
+ }
+ else
+ {
+ return new Bounds(Vector3.zero, Vector3.zero);
+ }
}
- public override void SetBounds (Bounds newBounds)
- {
- throw new NotImplementedException ();
- }
+ public override void SetBounds(Bounds newBounds)
+ {
+ throw new NotImplementedException();
+ }
- public override Bounds GetBoundsTransformed()
- {
- if (polygons.Length > 0)
- {
- Bounds bounds = new Bounds(transform.TransformPoint(polygons[0].Vertices[0].Position), Vector3.zero);
-
- for (int i = 0; i < polygons.Length; i++)
- {
- for (int j = 0; j < polygons[i].Vertices.Length; j++)
- {
- bounds.Encapsulate(transform.TransformPoint(polygons[i].Vertices[j].Position));
- }
- }
- return bounds;
- }
- else
- {
- return new Bounds(Vector3.zero, Vector3.zero);
- }
- }
+ public override Bounds GetBoundsTransformed()
+ {
+ if (polygons.Length > 0)
+ {
+ Bounds bounds = new Bounds(transform.TransformPoint(polygons[0].Vertices[0].Position), Vector3.zero);
+
+ for (int i = 0; i < polygons.Length; i++)
+ {
+ for (int j = 0; j < polygons[i].Vertices.Length; j++)
+ {
+ bounds.Encapsulate(transform.TransformPoint(polygons[i].Vertices[j].Position));
+ }
+ }
+ return bounds;
+ }
+ else
+ {
+ return new Bounds(Vector3.zero, Vector3.zero);
+ }
+ }
public override Bounds GetBoundsLocalTo(Transform otherTransform)
{
@@ -749,168 +841,175 @@ public override Bounds GetBoundsLocalTo(Transform otherTransform)
}
public float CalculateExtentsInAxis(Vector3 worldAxis)
- {
- // Transform the world axis direction to local
- Vector3 localAxis = transform.InverseTransformDirection(worldAxis);
+ {
+ // Transform the world axis direction to local
+ Vector3 localAxis = transform.InverseTransformDirection(worldAxis);
- float minDot = Vector3.Dot(polygons[0].Vertices[0].Position, localAxis);
- float maxDot = minDot;
+ float minDot = Vector3.Dot(polygons[0].Vertices[0].Position, localAxis);
+ float maxDot = minDot;
- for (int i = 0; i < polygons.Length; i++)
- {
- for (int j = 0; j < polygons[i].Vertices.Length; j++)
- {
- float dot = Vector3.Dot(polygons[i].Vertices[j].Position, localAxis);
- minDot = Mathf.Min(dot, minDot);
- maxDot = Mathf.Max(dot, maxDot);
- }
- }
+ for (int i = 0; i < polygons.Length; i++)
+ {
+ for (int j = 0; j < polygons[i].Vertices.Length; j++)
+ {
+ float dot = Vector3.Dot(polygons[i].Vertices[j].Position, localAxis);
+ minDot = Mathf.Min(dot, minDot);
+ maxDot = Mathf.Max(dot, maxDot);
+ }
+ }
- return maxDot - minDot;
- }
-
- public override int[] GetPolygonIDs ()
- {
- int[] ids = new int[polygons.Length];
- for (int i = 0; i < polygons.Length; i++)
- {
- ids[i] = polygons[i].UniqueIndex;
- }
- return ids;
- }
+ return maxDot - minDot;
+ }
- public override Polygon[] GetPolygons ()
- {
- return polygons;
- }
+ public override int[] GetPolygonIDs()
+ {
+ int[] ids = new int[polygons.Length];
+ for (int i = 0; i < polygons.Length; i++)
+ {
+ ids[i] = polygons[i].UniqueIndex;
+ }
+ return ids;
+ }
- public override int AssignUniqueIDs (int startingIndex)
- {
- for (int i = 0; i < polygons.Length; i++)
- {
- int uniqueIndex = startingIndex + i;
- polygons[i].UniqueIndex = uniqueIndex;
- }
+ public override Polygon[] GetPolygons()
+ {
+ return polygons;
+ }
- int assignedCount = polygons.Length;
-
- return assignedCount;
- }
+ public override int AssignUniqueIDs(int startingIndex)
+ {
+ for (int i = 0; i < polygons.Length; i++)
+ {
+ int uniqueIndex = startingIndex + i;
+ polygons[i].UniqueIndex = uniqueIndex;
+ }
- ///
- /// Resets the pivot to the center of the brush. The world position of vertices remains unchanged, but the brush position and local vertex positions are updated so that the pivot is at the center.
- ///
- public void ResetPivot()
- {
- Vector3 delta = GetBounds().center;
+ int assignedCount = polygons.Length;
- for (int i = 0; i < polygons.Length; i++)
- {
- for (int j = 0; j < polygons[i].Vertices.Length; j++)
- {
- polygons[i].Vertices[j].Position -= delta;
- }
- }
+ return assignedCount;
+ }
- // Bounds is aligned with the object
- transform.Translate(delta.Multiply(transform.localScale));
+ ///
+ /// Resets the pivot to the center of the brush. The world position of vertices remains unchanged, but the brush position and local vertex positions are updated so that the pivot is at the center.
+ ///
+ public void ResetPivot()
+ {
+ Vector3 delta = GetBounds().center;
- // Counter the delta offset
- Transform[] childTransforms = transform.GetComponentsInChildren(true);
+ for (int i = 0; i < polygons.Length; i++)
+ {
+ for (int j = 0; j < polygons[i].Vertices.Length; j++)
+ {
+ polygons[i].Vertices[j].Position -= delta;
+ }
+ }
- for (int i = 0; i < childTransforms.Length; i++)
- {
- if(childTransforms[i] != transform)
- {
- childTransforms[i].Translate(-delta);
- }
- }
+ // Bounds is aligned with the object
+ transform.Translate(delta.Multiply(transform.localScale));
- // Only invalidate if it's actually been realigned
- if(delta != Vector3.zero)
- {
- Invalidate(true);
- }
- }
-
- ///
- /// Duplicates the brush game object and returns the new object.
- ///
- /// The game object of the new brush.
- public GameObject Duplicate()
- {
- GameObject newObject = Instantiate(this.gameObject);
+ // Counter the delta offset
+ Transform[] childTransforms = transform.GetComponentsInChildren(true);
- newObject.name = this.gameObject.name;
+ for (int i = 0; i < childTransforms.Length; i++)
+ {
+ if (childTransforms[i] != transform)
+ {
+ childTransforms[i].Translate(-delta);
+ }
+ }
- newObject.transform.parent = this.transform.parent;
+ // Only invalidate if it's actually been realigned
+ if (delta != Vector3.zero)
+ {
+ Invalidate(true);
+ }
+ }
- return newObject;
- }
+ ///
+ /// Duplicates the brush game object and returns the new object.
+ ///
+ /// The game object of the new brush.
+ public GameObject Duplicate()
+ {
+ GameObject newObject = Instantiate(this.gameObject);
- public override void PrepareToBuild(List brushes, bool forceRebuild)
- {
- if(forceRebuild)
- {
- brushCache.SetUnbuilt();
- RecachePolygons(true);
- RecalculateIntersections(brushes, false);
- }
- }
+ newObject.name = this.gameObject.name;
- ///
- /// Get the CSG Model that the brush is under
- ///
- /// The CSG Model.
- public CSGModelBase GetCSGModel()
- {
- if (parentCsgModel == null)
- {
- CSGModelBase[] models = transform.GetComponentsInParent(true);
- if(models.Length > 0)
- {
- parentCsgModel = models[0];
- }
- }
- return parentCsgModel;
- }
+ // copy the scale with checks for scaled parents and being of a scaled child.
+ newObject.transform.parent = null;
+ newObject.transform.localScale = this.transform.lossyScale;
+ newObject.transform.parent = this.transform.parent;
- public override void UpdateCachedBrushOrder ()
- {
- Transform csgModelTransform = GetCSGModel().transform;
+ // copy the world position as compound brush children brushes have position 0,0,0.
+ // once parented they will end up at world position 0,0,0 if this step isn't done.
+ newObject.transform.position = this.transform.position;
+
+ return newObject;
+ }
+
+ public override void PrepareToBuild(List brushes, bool forceRebuild)
+ {
+ if (forceRebuild)
+ {
+ brushCache.SetUnbuilt();
+ RecachePolygons(true);
+ RecalculateIntersections(brushes, false);
+ }
+ }
- List reversePositions = new List();
+ ///
+ /// Get the CSG Model that the brush is under
+ ///
+ /// The CSG Model.
+ public CSGModelBase GetCSGModel()
+ {
+ if (parentCsgModel == null)
+ {
+ CSGModelBase[] models = transform.GetComponentsInParent(true);
+ if (models.Length > 0)
+ {
+ parentCsgModel = models[0];
+ }
+ }
+ return parentCsgModel;
+ }
- Transform traversedTransform = transform;
+ public override void UpdateCachedBrushOrder()
+ {
+ Transform csgModelTransform = GetCSGModel().transform;
- reversePositions.Add(traversedTransform.GetSiblingIndex());
+ List reversePositions = new List();
- while(traversedTransform.parent != null && traversedTransform.parent != csgModelTransform)
- {
- traversedTransform = traversedTransform.parent;
- reversePositions.Add(traversedTransform.GetSiblingIndex());
- }
+ Transform traversedTransform = transform;
- BrushOrder brushOrder = new BrushOrder();
- int count = reversePositions.Count;
- brushOrder.Position = new int[count];
- for (int i = 0; i < count; i++)
- {
- brushOrder.Position[i] = reversePositions[count-1-i];
- }
+ reversePositions.Add(traversedTransform.GetSiblingIndex());
- cachedBrushOrder = brushOrder;
- }
+ while (traversedTransform.parent != null && traversedTransform.parent != csgModelTransform)
+ {
+ traversedTransform = traversedTransform.parent;
+ reversePositions.Add(traversedTransform.GetSiblingIndex());
+ }
- public override BrushOrder GetBrushOrder ()
- {
- if(cachedBrushOrder == null)
- {
- UpdateCachedBrushOrder();
- }
+ BrushOrder brushOrder = new BrushOrder();
+ int count = reversePositions.Count;
+ brushOrder.Position = new int[count];
+ for (int i = 0; i < count; i++)
+ {
+ brushOrder.Position[i] = reversePositions[count - 1 - i];
+ }
- return cachedBrushOrder;
- }
+ cachedBrushOrder = brushOrder;
+ }
+
+ public override BrushOrder GetBrushOrder()
+ {
+ if (cachedBrushOrder == null)
+ {
+ UpdateCachedBrushOrder();
+ }
+
+ return cachedBrushOrder;
+ }
#if (UNITY_5_0 || UNITY_5_1)
void OnDrawGizmosSelected()
diff --git a/Scripts/CSGModel.cs b/Scripts/CSGModel.cs
index 76fa47b8..c5add3bc 100644
--- a/Scripts/CSGModel.cs
+++ b/Scripts/CSGModel.cs
@@ -14,138 +14,148 @@
namespace Sabresaurus.SabreCSG
{
[ExecuteInEditMode]
- public class CSGModel : CSGModelBase
- {
+ public class CSGModel : CSGModelBase
+ {
#if UNITY_EDITOR
- [SerializeField,HideInInspector]
- bool firstRun = true;
- const int MODEL_VERSION = 1;
+ [SerializeField, HideInInspector]
+ private bool firstRun = true;
+
+ private const int MODEL_VERSION = 1;
+
+ // Warning disabled as this field is not in use yet, but helps future proof some cases
+#pragma warning disable 414
+
+ [SerializeField, HideInInspector]
+ private int modelVersion = 0;
- // Warning disabled as this field is not in use yet, but helps future proof some cases
-#pragma warning disable 414
- [SerializeField,HideInInspector]
- int modelVersion = 0;
#pragma warning restore 414
-
- [SerializeField,HideInInspector]
- bool autoRebuild = false;
- bool editMode = false;
- static CSGModel editModeModel = null;
+ [SerializeField, HideInInspector]
+ private bool autoRebuild = false;
- bool mouseIsDragging = false;
- bool mouseIsHeld = false;
- DateTime mouseReleaseTime = DateTime.MinValue;
+ private bool editMode = false;
+ private static CSGModel editModeModel = null;
- // Tools
- Tool activeTool = null;
+ private bool mouseIsDragging = false;
+ private bool mouseIsHeld = false;
+ private bool mouseIsDoubleClick = false;
+ private DateTime mouseReleaseTime = DateTime.MinValue;
- // Used to track what objects have been previously clicked on, so that the user can cycle click through objects
- // on the same (or similar) ray cast
- List previousHits = new List();
- List lastHitSet = new List();
+ // Tools
+ private Tool activeTool = null;
- // Marked as serialized to persist through recompiles, used by draw tool
- [SerializeField,HideInInspector]
- Brush lastSelectedBrush = null;
+ // Used to track what objects have been previously clicked on, so that the user can cycle click through objects
+ // on the same (or similar) ray cast
+ private List previousHits = new List();
- float currentFrameTimestamp = 0;
- float currentFrameDelta = 0;
+ private List lastHitSet = new List();
- static bool anyCSGModelsInEditMode = false;
+ // Marked as serialized to persist through recompiles, used by draw tool
+ [SerializeField, HideInInspector]
+ private Brush lastSelectedBrush = null;
- static UnityEngine.Object[] deferredSelection = null;
+ private float currentFrameTimestamp = 0;
+ private float currentFrameDelta = 0;
- public float CurrentFrameDelta {
- get {
- return currentFrameDelta;
- }
- }
+ private static bool anyCSGModelsInEditMode = false;
- Dictionary tools = new Dictionary()
- {
- { MainMode.Resize, new ResizeEditor() },
- { MainMode.Vertex, new VertexEditor() },
- { MainMode.Face, new SurfaceEditor() },
- { MainMode.Clip, new ClipEditor() },
- { MainMode.Draw, new DrawEditor() },
- };
-
- Dictionary overrideTools = new Dictionary()
+ private static UnityEngine.Object[] deferredSelection = null;
+
+ public float CurrentFrameDelta
+ {
+ get
+ {
+ return currentFrameDelta;
+ }
+ }
+
+ private Dictionary tools = new Dictionary()
+ {
+ { MainMode.Resize, new ResizeEditor() },
+ { MainMode.Vertex, new VertexEditor() },
+ { MainMode.Face, new SurfaceEditor() },
+ { MainMode.Clip, new ClipEditor() },
+ { MainMode.Draw, new DrawEditor() },
+ };
+
+ private Dictionary overrideTools = new Dictionary()
{
{ OverrideMode.TransformModel, new TransformModelEditor() },
//{ OverrideMode.Clip, new ClipEditor() },
//{ OverrideMode.Draw, new DrawEditor() },
};
- public bool MouseIsDragging
- {
- get
- {
- return mouseIsDragging;
- }
- }
+ public bool MouseIsDragging
+ {
+ get
+ {
+ return mouseIsDragging;
+ }
+ }
- public bool MouseIsHeld
- {
- get
- {
- return mouseIsHeld;
- }
- }
+ public bool MouseIsHeld
+ {
+ get
+ {
+ return mouseIsHeld;
+ }
+ }
- public bool MouseIsHeldOrRecent
- {
- get
- {
- return mouseIsHeld || (MouseReleaseDuration < 0.22f);
- }
- }
+ public bool MouseIsHeldOrRecent
+ {
+ get
+ {
+ return mouseIsHeld || (MouseReleaseDuration < 0.22f);
+ }
+ }
- public double MouseReleaseDuration
- {
- get
- {
- return (DateTime.UtcNow - mouseReleaseTime).TotalSeconds;
- }
- }
+ public double MouseReleaseDuration
+ {
+ get
+ {
+ return (DateTime.UtcNow - mouseReleaseTime).TotalSeconds;
+ }
+ }
- public Brush LastSelectedBrush
- {
- get
- {
- return lastSelectedBrush;
- }
- }
+ public Brush LastSelectedBrush
+ {
+ get
+ {
+ return lastSelectedBrush;
+ }
+ }
- public bool AutoRebuild {
- get {
- return autoRebuild;
- }
- set {
- autoRebuild = value;
- }
- }
+ public bool AutoRebuild
+ {
+ get
+ {
+ return autoRebuild;
+ }
+ set
+ {
+ autoRebuild = value;
+ }
+ }
+
+ protected override void Start()
+ {
+ UpdateUtility.RunCleanup();
- protected override void Start ()
- {
- UpdateUtility.RunCleanup();
-
// SabreCSG turns off Auto Generate, but loading a scene in editor will look too dark without it, so force refresh
DynamicGI.UpdateEnvironment();
- base.Start ();
+ base.Start();
- if(firstRun)
- {
- // Make sure editing is turned on
- EditMode = true;
+ if (firstRun)
+ {
+ // Make sure editing is turned on
+ EditMode = true;
brushes = new List(transform.GetComponentsInChildren(false));
// Only create a brush if the model doesn't already contain one
- if(brushes.Count == 0)
+ if (brushes.Count == 0)
{
// Create the default brush
GameObject newBrushObject = CreateBrush(PrimitiveBrushType.Cube, new Vector3(0, 1, 0));
@@ -154,64 +164,64 @@ protected override void Start ()
}
firstRun = false;
- EditorHelper.SetDirty(this);
- }
+ EditorHelper.SetDirty(this);
+ }
- // Make sure we are correctly tracking whether any CSG Models are actually in edit mode
- bool wereAnyInEditMode = anyCSGModelsInEditMode;
- anyCSGModelsInEditMode = false;
- CSGModel[] csgModels = FindObjectsOfType();
+ // Make sure we are correctly tracking whether any CSG Models are actually in edit mode
+ bool wereAnyInEditMode = anyCSGModelsInEditMode;
+ anyCSGModelsInEditMode = false;
+ CSGModel[] csgModels = FindObjectsOfType();
- // Loop through all the CSG Models in the scene and check if any are in edit mode
- for (int i = 0; i < csgModels.Length; i++)
- {
- if(csgModels[i] != this
- && csgModels[i].EditMode)
- {
- anyCSGModelsInEditMode = true;
- }
- }
+ // Loop through all the CSG Models in the scene and check if any are in edit mode
+ for (int i = 0; i < csgModels.Length; i++)
+ {
+ if (csgModels[i] != this
+ && csgModels[i].EditMode)
+ {
+ anyCSGModelsInEditMode = true;
+ }
+ }
- // If the status of whether any Models are in edit mode has changed, make sure all the brushes update their
- // visibility. For example we moved from editing a CSG Model to opening another scene where no CSG Model is
- // in edit mode. wereAnyInEditMode would be true and anyCSGModelsInEditMode would now be false
- if(anyCSGModelsInEditMode != wereAnyInEditMode)
- {
+ // If the status of whether any Models are in edit mode has changed, make sure all the brushes update their
+ // visibility. For example we moved from editing a CSG Model to opening another scene where no CSG Model is
+ // in edit mode. wereAnyInEditMode would be true and anyCSGModelsInEditMode would now be false
+ if (anyCSGModelsInEditMode != wereAnyInEditMode)
+ {
UpdateAllBrushesVisibility();
- }
+ }
- if(modelVersion < MODEL_VERSION)
- {
- // Upgrading or a new model, so grab all the brushes in case it's an upgrade
- brushes = new List(transform.GetComponentsInChildren(false));
+ if (modelVersion < MODEL_VERSION)
+ {
+ // Upgrading or a new model, so grab all the brushes in case it's an upgrade
+ brushes = new List(transform.GetComponentsInChildren(false));
- // Make sure all brushes have a valid brush cache and need rebuilding
- for (int i = 0; i < brushes.Count; i++)
- {
- if(brushes[i] != null)
- {
- brushes[i].RecachePolygons(true);
- }
- }
+ // Make sure all brushes have a valid brush cache and need rebuilding
+ for (int i = 0; i < brushes.Count; i++)
+ {
+ if (brushes[i] != null)
+ {
+ brushes[i].RecachePolygons(true);
+ }
+ }
- // Force all brushes to recalculate intersections
- for (int i = 0; i < brushes.Count; i++)
- {
- if(brushes[i] != null)
- {
- brushes[i].RecalculateIntersections(brushes, false);
- }
- }
+ // Force all brushes to recalculate intersections
+ for (int i = 0; i < brushes.Count; i++)
+ {
+ if (brushes[i] != null)
+ {
+ brushes[i].RecalculateIntersections(brushes, false);
+ }
+ }
- // Finally now that the potential upgrade is complete, track that the model is the correct version now
- modelVersion = MODEL_VERSION;
- }
- }
+ // Finally now that the potential upgrade is complete, track that the model is the correct version now
+ modelVersion = MODEL_VERSION;
+ }
+ }
public override void Build(bool forceRebuild, bool buildInBackground)
{
// Build can take place if meshes are not saved to the DB, or if the scene is saved
- if(!buildSettings.SaveMeshesAsAssets || EnsureUntitledSceneHasBeenSaved("Scene must be saved for SaveMeshesAsAssets to work"))
+ if (!buildSettings.SaveMeshesAsAssets || EnsureUntitledSceneHasBeenSaved("Scene must be saved for SaveMeshesAsAssets to work"))
{
base.Build(forceRebuild, buildInBackground);
}
@@ -221,13 +231,13 @@ private bool EnsureUntitledSceneHasBeenSaved(string message)
{
#if UNITY_5_6_OR_NEWER || UNITY_5_6
return UnityEditor.SceneManagement.EditorSceneManager.EnsureUntitledSceneHasBeenSaved(message);
-
+
#elif UNITY_5_3_OR_NEWER
if(string.IsNullOrEmpty(SceneManager.GetActiveScene().path)) // Scene not saved
{
// Ask the user to save
UnityEditor.SceneManagement.EditorSceneManager.SaveCurrentModifiedScenesIfUserWantsTo();
-
+
// Check that the scene was saved
if(!string.IsNullOrEmpty(SceneManager.GetActiveScene().path))
{
@@ -265,234 +275,232 @@ private bool EnsureUntitledSceneHasBeenSaved(string message)
#endif
}
- public override void OnBuildComplete ()
- {
- base.OnBuildComplete ();
+ public override void OnBuildComplete()
+ {
+ base.OnBuildComplete();
- EditorUtility.ClearProgressBar();
+ EditorUtility.ClearProgressBar();
UpdateAllBrushesVisibility();
- EditorHelper.SetDirty(this);
- SetContextDirty();
- }
+ EditorHelper.SetDirty(this);
+ SetContextDirty();
+ }
- public void OnSceneGUI(SceneView sceneView)
- {
- if(Event.current.type == EventType.ExecuteCommand)
- {
- if(Event.current.commandName == "Duplicate")
- {
- if(EditorHelper.DuplicateSelection())
- {
- Event.current.Use();
- }
- }
- }
- Event e = Event.current;
+ public void OnSceneGUI(SceneView sceneView)
+ {
+ if (Event.current.type == EventType.ExecuteCommand)
+ {
+ if (Event.current.commandName == "Duplicate")
+ {
+ if (EditorHelper.DuplicateSelection())
+ {
+ Event.current.Use();
+ }
+ }
+ }
+ Event e = Event.current;
- if(!EditMode)
- {
- return;
- }
+ if (!EditMode)
+ {
+ return;
+ }
- RadialMenu.OnEarlySceneGUI(sceneView);
+ RadialMenu.OnEarlySceneGUI(sceneView);
- // Frame rate tracking
- if(e.type == EventType.Repaint)
- {
- currentFrameDelta = Time.realtimeSinceStartup - currentFrameTimestamp;
- currentFrameTimestamp = Time.realtimeSinceStartup;
- }
+ // Frame rate tracking
+ if (e.type == EventType.Repaint)
+ {
+ currentFrameDelta = Time.realtimeSinceStartup - currentFrameTimestamp;
+ currentFrameTimestamp = Time.realtimeSinceStartup;
+ }
- // Raw checks for tracking mouse events (use raw so that consumed events are not ignored)
- if (e.rawType == EventType.MouseDown)
- {
- mouseIsDragging = false;
- mouseIsHeld = true;
+ // Raw checks for tracking mouse events (use raw so that consumed events are not ignored)
+ if (e.rawType == EventType.MouseDown)
+ {
+ mouseIsDragging = false;
+ mouseIsHeld = true;
- if(e.button == 0 && GUIUtility.hotControl == 0 )
- {
- GUIUtility.keyboardControl = 0;
- }
+ if (e.button == 0 && GUIUtility.hotControl == 0)
+ {
+ GUIUtility.keyboardControl = 0;
+ }
+ }
+ else if (e.rawType == EventType.MouseDrag)
+ {
+ mouseIsDragging = true;
+ }
+ else if (e.rawType == EventType.MouseUp)
+ {
+ mouseIsHeld = false;
+ mouseReleaseTime = DateTime.UtcNow;
+ }
- }
- else if (e.rawType == EventType.MouseDrag)
- {
- mouseIsDragging = true;
- }
- else if (e.rawType == EventType.MouseUp)
- {
- mouseIsHeld = false;
- mouseReleaseTime = DateTime.UtcNow;
- }
+ // if (CurrentSettings.BrushesVisible)
+ {
+ // No idea what this line of code means, but it seems to stop normal mouse selection
+ HandleUtility.AddDefaultControl(GUIUtility.GetControlID(FocusType.Passive));
+ }
-// if (CurrentSettings.BrushesVisible)
- {
- // No idea what this line of code means, but it seems to stop normal mouse selection
- HandleUtility.AddDefaultControl(GUIUtility.GetControlID(FocusType.Passive));
- }
+ if (EditMode && CurrentSettings.OverrideMode != OverrideMode.TransformModel)
+ {
+ // In CSG mode, prevent the normal tools, so that the user must use our tools instead
+ Tools.current = UnityEditor.Tool.None;
+ }
- if(EditMode && CurrentSettings.OverrideMode != OverrideMode.TransformModel)
- {
- // In CSG mode, prevent the normal tools, so that the user must use our tools instead
- Tools.current = UnityEditor.Tool.None;
- }
+ int concaveBrushCount = 0;
+ for (int i = 0; i < brushes.Count; i++)
+ {
+ if (brushes[i] != null && !brushes[i].IsBrushConvex)
+ {
+ concaveBrushCount++;
+ }
+ }
+ if (concaveBrushCount > 0)
+ {
+ Toolbar.WarningMessage = concaveBrushCount + " Concave Brush" + (concaveBrushCount > 1 ? "es" : "") + " Detected";
+ }
+ else
+ {
+ // Toolbar.WarningMessage = "";
+ }
- int concaveBrushCount = 0;
- for (int i = 0; i < brushes.Count; i++)
- {
- if(brushes[i] != null && !brushes[i].IsBrushConvex)
- {
- concaveBrushCount++;
- }
- }
- if(concaveBrushCount > 0)
- {
- Toolbar.WarningMessage = concaveBrushCount + " Concave Brush" + (concaveBrushCount > 1 ? "es" : "") + " Detected";
- }
- else
- {
- // Toolbar.WarningMessage = "";
- }
+ Toolbar.CSGModel = this;
+ Toolbar.OnSceneGUI(sceneView, e);
- Toolbar.CSGModel = this;
- Toolbar.OnSceneGUI(sceneView, e);
+ if (e.type == EventType.Repaint)// || e.type == EventType.Layout)
+ {
+ if (CurrentSettings.ShowExcludedPolygons)
+ {
+ List allPolygons = BuildContext.VisualPolygons ?? new List();
+ List excluded = new List();
+ for (int i = 0; i < allPolygons.Count; i++)
+ {
+ if (allPolygons[i].UserExcludeFromFinal)
+ {
+ excluded.Add(allPolygons[i]);
+ }
+ }
+ SabreCSGResources.GetExcludedMaterial().SetPass(0);
- if (e.type == EventType.Repaint)// || e.type == EventType.Layout)
- {
- if(CurrentSettings.ShowExcludedPolygons)
- {
- List allPolygons = BuildContext.VisualPolygons ?? new List();
- List excluded = new List();
- for (int i = 0; i < allPolygons.Count; i++)
- {
- if(allPolygons[i].UserExcludeFromFinal)
- {
- excluded.Add(allPolygons[i]);
- }
- }
- SabreCSGResources.GetExcludedMaterial().SetPass(0);
+ Mesh mesh = new Mesh();
+ BrushFactory.GenerateMeshFromPolygonsFast(excluded.ToArray(), ref mesh, 0.0f);
- Mesh mesh = new Mesh();
- List indices = new List();
- BrushFactory.GenerateMeshFromPolygons(excluded.ToArray(), ref mesh, out indices);
+ Graphics.DrawMeshNow(mesh, Vector3.zero, Quaternion.identity);
- Graphics.DrawMeshNow(mesh, Vector3.zero, Quaternion.identity);
+ // SabreGraphics.DrawPolygons(new Color(1,1,0,0.65f), new Color(1,0.8f,0,0.9f), excluded.ToArray());
+ }
-// SabreGraphics.DrawPolygons(new Color(1,1,0,0.65f), new Color(1,0.8f,0,0.9f), excluded.ToArray());
- }
+ if (activeTool == null || activeTool.BrushesHandleDrawing)
+ {
+ SabreCSGResources.GetSelectedBrushMaterial().SetPass(0);
+ // Selection
+ GL.Begin(GL.LINES);
+ Color outlineColor = Color.blue;
- if (activeTool == null || activeTool.BrushesHandleDrawing)
- {
- SabreCSGResources.GetSelectedBrushMaterial().SetPass(0);
- // Selection
- GL.Begin(GL.LINES);
- Color outlineColor = Color.blue;
+ for (int brushIndex = 0; brushIndex < brushes.Count; brushIndex++)
+ {
+ Brush brush = brushes[brushIndex];
+ if (brush == null)
+ {
+ continue;
+ }
+ GameObject brushGameObject = brush.gameObject;
- for (int brushIndex = 0; brushIndex < brushes.Count; brushIndex++)
- {
- Brush brush = brushes[brushIndex];
- if(brush == null)
- {
- continue;
- }
- GameObject brushGameObject = brush.gameObject;
-
- if(!brushGameObject.activeInHierarchy)
- {
- continue;
- }
-
- if (Selection.Contains(brushGameObject))
- {
- if (brushes[brushIndex].IsNoCSG)
- {
- outlineColor = new Color(1f,0.6f,1.0f);
- }
- else
- {
- if (brushes[brushIndex].Mode == CSGMode.Add)
- {
- outlineColor = Color.cyan;
- }
- else
- {
- outlineColor = Color.yellow;
- }
- }
- }
- else if(CurrentSettings.BrushesVisible)
- {
- if (brushes[brushIndex].IsNoCSG)
- {
- outlineColor = new Color(0.8f,0.3f,1.0f);
- }
- else
- {
- if (brushes[brushIndex].Mode == CSGMode.Add)
- {
- outlineColor = Color.blue;
- }
- else
- {
- outlineColor = new Color32(255, 130, 0, 255);
- }
- }
- }
- else
- {
- continue;
- }
-
- GL.Color(outlineColor);
-
- Polygon[] polygons = brush.GetPolygons();
- Transform brushTransform = brush.transform;
-
- // Brush Outline
- for (int i = 0; i < polygons.Length; i++)
- {
- Polygon polygon = polygons[i];
-
- for (int j = 0; j < polygon.Vertices.Length; j++)
- {
- Vector3 position = brushTransform.TransformPoint(polygon.Vertices[j].Position);
- GL.Vertex(position);
-
- if (j < polygon.Vertices.Length - 1)
- {
- Vector3 position2 = brushTransform.TransformPoint(polygon.Vertices[j + 1].Position);
- GL.Vertex(position2);
- }
- else
- {
- Vector3 position2 = brushTransform.TransformPoint(polygon.Vertices[0].Position);
- GL.Vertex(position2);
- }
- }
- }
- }
+ if (!brushGameObject.activeInHierarchy)
+ {
+ continue;
+ }
- GL.End();
+ if (Selection.Contains(brushGameObject))
+ {
+ if (brushes[brushIndex].IsNoCSG)
+ {
+ outlineColor = new Color(1f, 0.6f, 1.0f);
+ }
+ else
+ {
+ if (brushes[brushIndex].Mode == CSGMode.Add)
+ {
+ outlineColor = Color.cyan;
+ }
+ else
+ {
+ outlineColor = Color.yellow;
+ }
+ }
+ }
+ else if (CurrentSettings.BrushesVisible)
+ {
+ if (brushes[brushIndex].IsNoCSG)
+ {
+ outlineColor = new Color(0.8f, 0.3f, 1.0f);
+ }
+ else
+ {
+ if (brushes[brushIndex].Mode == CSGMode.Add)
+ {
+ outlineColor = Color.blue;
+ }
+ else
+ {
+ outlineColor = new Color32(255, 130, 0, 255);
+ }
+ }
+ }
+ else
+ {
+ continue;
+ }
- for (int i = 0; i < brushes.Count; i++)
- {
- if (brushes[i] is PrimitiveBrush && brushes[i] != null && brushes[i].gameObject.activeInHierarchy)
- {
- ((PrimitiveBrush)brushes[i]).OnRepaint(sceneView, e);
- }
- }
- }
- }
+ GL.Color(outlineColor);
- if (e.type == EventType.Repaint)
- {
- Rect rect = new Rect(0, 0, Screen.width, Screen.height);
- EditorGUIUtility.AddCursorRect(rect, SabreMouse.ActiveCursor);
- }
+ Polygon[] polygons = brush.GetPolygons();
+ Transform brushTransform = brush.transform;
+
+ // Brush Outline
+ for (int i = 0; i < polygons.Length; i++)
+ {
+ Polygon polygon = polygons[i];
+
+ for (int j = 0; j < polygon.Vertices.Length; j++)
+ {
+ Vector3 position = brushTransform.TransformPoint(polygon.Vertices[j].Position);
+ GL.Vertex(position);
+
+ if (j < polygon.Vertices.Length - 1)
+ {
+ Vector3 position2 = brushTransform.TransformPoint(polygon.Vertices[j + 1].Position);
+ GL.Vertex(position2);
+ }
+ else
+ {
+ Vector3 position2 = brushTransform.TransformPoint(polygon.Vertices[0].Position);
+ GL.Vertex(position2);
+ }
+ }
+ }
+ }
+
+ GL.End();
+
+ for (int i = 0; i < brushes.Count; i++)
+ {
+ if (brushes[i] is PrimitiveBrush && brushes[i] != null && brushes[i].gameObject.activeInHierarchy)
+ {
+ ((PrimitiveBrush)brushes[i]).OnRepaint(sceneView, e);
+ }
+ }
+ }
+ }
+
+ if (e.type == EventType.Repaint)
+ {
+ Rect rect = new Rect(0, 0, Screen.width, Screen.height);
+ EditorGUIUtility.AddCursorRect(rect, SabreMouse.ActiveCursor);
+ }
- if(e.type == EventType.Layout)
+ if (e.type == EventType.Layout)
{
// Don't need to do this for every OnSceneGUI call, so limit it to Layout events
if (activeTool == null
@@ -501,119 +509,159 @@ public void OnSceneGUI(SceneView sceneView)
UpdateActiveTool();
}
}
-
- if(activeTool != null)
- {
- activeTool.CSGModel = this;
- activeTool.SetSelection(Selection.activeGameObject, Selection.gameObjects);
- activeTool.OnSceneGUI(sceneView, e);
- }
-// if(e.type == EventType.DragPerform)
-// {
-// Ray ray = HandleUtility.GUIPointToWorldRay(Event.current.mousePosition);
-//
-// RaycastHit hit = new RaycastHit();
-//
-// int layerMask = 1 << LayerMask.NameToLayer("CSGMesh");
-// // Invert the layer mask
-// layerMask = ~layerMask;
-//
-// // Shift mode means only add what they click (clicking nothing does nothing)
-// if (Physics.Raycast(ray, out hit, float.PositiveInfinity, layerMask))
-// {
-// OnDragDrop(hit.collider.gameObject);
-// }
-// }
-
- if (e.type == EventType.MouseUp && !RadialMenu.IsActive)
- {
- OnMouseUp(sceneView, e);
- SabreMouse.ResetCursor();
- }
- else if (e.type == EventType.KeyDown || e.type == EventType.KeyUp)
- {
- OnKeyAction(sceneView, e);
- }
+ if (activeTool != null)
+ {
+ activeTool.CSGModel = this;
+ activeTool.SetSelection(Selection.activeGameObject, Selection.gameObjects);
+ activeTool.OnSceneGUI(sceneView, e);
+ }
- if(CurrentSettings.OverrideFlyCamera)
- {
- LinearFPSCam.OnSceneGUI(sceneView);
- }
+ // if(e.type == EventType.DragPerform)
+ // {
+ // Ray ray = HandleUtility.GUIPointToWorldRay(Event.current.mousePosition);
+ //
+ // RaycastHit hit = new RaycastHit();
+ //
+ // int layerMask = 1 << LayerMask.NameToLayer("CSGMesh");
+ // // Invert the layer mask
+ // layerMask = ~layerMask;
+ //
+ // // Shift mode means only add what they click (clicking nothing does nothing)
+ // if (Physics.Raycast(ray, out hit, float.PositiveInfinity, layerMask))
+ // {
+ // OnDragDrop(hit.collider.gameObject);
+ // }
+ // }
+
+ if (e.type == EventType.MouseDown && e.clickCount == 2)
+ {
+ mouseIsDoubleClick = true;
+ OnMouseDoubleClick(sceneView, e);
+ }
+ if (e.type == EventType.MouseUp && !RadialMenu.IsActive)
+ {
+ OnMouseUp(sceneView, e);
+ mouseIsDoubleClick = false;
- RadialMenu.OnLateSceneGUI(sceneView);
- }
+ SabreMouse.ResetCursor();
+ }
+ else if (e.type == EventType.KeyDown || e.type == EventType.KeyUp)
+ {
+ OnKeyAction(sceneView, e);
+ }
- void OnMouseUp(SceneView sceneView, Event e)
- {
- if (mouseIsDragging
- || (activeTool != null && activeTool.PreventBrushSelection)
- || EditorHelper.IsMousePositionInInvalidRects(e.mousePosition))
- {
- SceneView.RepaintAll();
- return;
- }
+ if (CurrentSettings.OverrideFlyCamera)
+ {
+ LinearFPSCam.OnSceneGUI(sceneView);
+ }
- // Left click - select
- if (e.button == 0)
- {
- Ray ray = HandleUtility.GUIPointToWorldRay(Event.current.mousePosition);
- List hits = RaycastBrushesAll(ray, true);
- List hitBrushes = hits.Select(hit => hit.GameObject.GetComponent()).ToList();
- List hitBases = ExtractBrushBases(hitBrushes);
- List hitObjects = hitBases.Select(hit => hit.gameObject).ToList();
+ RadialMenu.OnLateSceneGUI(sceneView);
+ }
- GameObject selectedObject = null;
+ private void OnMouseDoubleClick(SceneView sceneView, Event e)
+ {
+ if (mouseIsDragging
+ || (activeTool != null && activeTool.PreventBrushSelection)
+ || EditorHelper.IsMousePositionInInvalidRects(e.mousePosition))
+ {
+ SceneView.RepaintAll();
+ return;
+ }
- if(hitObjects.Count == 0) // Didn't hit anything, blank the selection
- {
- previousHits.Clear();
- lastHitSet.Clear();
- }
- else if(hitObjects.Count == 1) // Only hit one thing, no ambiguity, this is what is selected
- {
- selectedObject = hitObjects[0];
- previousHits.Clear();
- lastHitSet.Clear();
- }
- else
- {
- if(!hitObjects.ContentsEquals(lastHitSet))
- {
- selectedObject = hitObjects[0];
- previousHits.Clear();
- lastHitSet = hitObjects;
- }
- else
- {
- // First try and select anything other than what has been previously hit
- for (int i = 0; i < hitObjects.Count; i++)
- {
- if(!previousHits.Contains(hitObjects[i]))
- {
- selectedObject = hitObjects[i];
- break;
- }
- }
-
- // Only found previously hit objects
- if(selectedObject == null)
- {
- // Walk backwards to find the oldest previous hit that has been hit by this ray
- for (int i = previousHits.Count-1; i >= 0 && selectedObject == null; i--)
- {
- for (int j = 0; j < hitObjects.Count; j++)
- {
- if(hitObjects[j] == previousHits[i])
- {
- selectedObject = previousHits[i];
- break;
- }
- }
- }
- }
- }
- }
+ // Left double click - select individual brush inside of a group.
+ if (e.button == 0)
+ {
+ Ray ray = HandleUtility.GUIPointToWorldRay(Event.current.mousePosition);
+ List hits = RaycastBrushesAll(ray, true);
+ List hitBrushes = hits.Select(hit => hit.GameObject.GetComponent()).ToList();
+ List hitObjects = hitBrushes.Select(hit => hit.gameObject).ToList();
+
+ if (hitObjects.Count >= 1)
+ {
+ if (hitObjects[0].transform.parent && hitObjects[0].transform.parent.GetComponent() != null)
+ {
+ Selection.activeGameObject = hitObjects[0];
+ previousHits.Clear();
+ lastHitSet.Clear();
+ }
+ }
+ }
+ }
+
+ private void OnMouseUp(SceneView sceneView, Event e)
+ {
+ if (mouseIsDragging
+ || (activeTool != null && activeTool.PreventBrushSelection)
+ || EditorHelper.IsMousePositionInInvalidRects(e.mousePosition))
+ {
+ SceneView.RepaintAll();
+ return;
+ }
+
+ // don't change the selection when double clicked.
+ if (mouseIsDoubleClick) return;
+
+ // Left click - select
+ if (e.button == 0)
+ {
+ Ray ray = HandleUtility.GUIPointToWorldRay(Event.current.mousePosition);
+ List hits = RaycastBrushesAll(ray, true);
+ List hitBrushes = hits.Select(hit => hit.GameObject.GetComponent()).ToList();
+ List hitBases = ExtractBrushBases(hitBrushes);
+ List hitObjects = hitBases.Select(hit => hit.gameObject).ToList();
+
+ GameObject selectedObject = null;
+
+ if (hitObjects.Count == 0) // Didn't hit anything, blank the selection
+ {
+ previousHits.Clear();
+ lastHitSet.Clear();
+ }
+ else if (hitObjects.Count == 1) // Only hit one thing, no ambiguity, this is what is selected
+ {
+ selectedObject = hitObjects[0];
+ previousHits.Clear();
+ lastHitSet.Clear();
+ }
+ else
+ {
+ if (!hitObjects.ContentsEquals(lastHitSet))
+ {
+ selectedObject = hitObjects[0];
+ previousHits.Clear();
+ lastHitSet = hitObjects;
+ }
+ else
+ {
+ // First try and select anything other than what has been previously hit
+ for (int i = 0; i < hitObjects.Count; i++)
+ {
+ if (!previousHits.Contains(hitObjects[i]))
+ {
+ selectedObject = hitObjects[i];
+ break;
+ }
+ }
+
+ // Only found previously hit objects
+ if (selectedObject == null)
+ {
+ // Walk backwards to find the oldest previous hit that has been hit by this ray
+ for (int i = previousHits.Count - 1; i >= 0 && selectedObject == null; i--)
+ {
+ for (int j = 0; j < hitObjects.Count; j++)
+ {
+ if (hitObjects[j] == previousHits[i])
+ {
+ selectedObject = previousHits[i];
+ break;
+ }
+ }
+ }
+ }
+ }
+ }
if (selectedObject != null)
{
@@ -623,122 +671,122 @@ void OnMouseUp(SceneView sceneView, Event e)
}
if (EnumHelper.IsFlagSet(e.modifiers, EventModifiers.Shift)
- || EnumHelper.IsFlagSet(e.modifiers, EventModifiers.Control)
- || EnumHelper.IsFlagSet(e.modifiers, EventModifiers.Command))
- {
- List objects = new List(Selection.objects);
+ || EnumHelper.IsFlagSet(e.modifiers, EventModifiers.Control)
+ || EnumHelper.IsFlagSet(e.modifiers, EventModifiers.Command))
+ {
+ List objects = new List(Selection.objects);
- if (objects.Contains(selectedObject))
- {
- objects.Remove(selectedObject);
- }
- else
- {
- objects.Add(selectedObject);
- }
- Selection.objects = objects.ToArray();
- }
- else
- {
- Selection.activeGameObject = selectedObject;
- }
-
- e.Use();
- }
- }
+ if (objects.Contains(selectedObject))
+ {
+ objects.Remove(selectedObject);
+ }
+ else
+ {
+ objects.Add(selectedObject);
+ }
+ Selection.objects = objects.ToArray();
+ }
+ else
+ {
+ Selection.activeGameObject = selectedObject;
+ }
- ///
- /// Subscribes to both KeyDown and KeyUp events from the SceneView delegate. This allows us to easily store key
- /// events in one place and mark them as used as necessary (for example to prevent error sounds on key down)
- ///
- void OnKeyAction(SceneView sceneView, Event e)
- {
- OnGenericKeyAction(sceneView, e);
- }
+ e.Use();
+ }
+ }
- private void OnGenericKeyAction(SceneView sceneView, Event e)
- {
- if (KeyMappings.EventsMatch(e, Event.KeyboardEvent(KeyMappings.Instance.ToggleMode))
- || KeyMappings.EventsMatch(e, Event.KeyboardEvent(KeyMappings.Instance.ToggleModeBack)))
- {
- // Toggle mode - immediately (key down)
- if (e.type == EventType.KeyDown)
- {
- int currentModeInt = (int)CurrentSettings.CurrentMode;
- int count = Enum.GetNames(typeof(MainMode)).Length;
+ ///
+ /// Subscribes to both KeyDown and KeyUp events from the SceneView delegate. This allows us to easily store key
+ /// events in one place and mark them as used as necessary (for example to prevent error sounds on key down)
+ ///
+ private void OnKeyAction(SceneView sceneView, Event e)
+ {
+ OnGenericKeyAction(sceneView, e);
+ }
- if(KeyMappings.EventsMatch(e, Event.KeyboardEvent(KeyMappings.Instance.ToggleModeBack)))
- {
- currentModeInt--;
- }
- else
- {
- currentModeInt++;
- }
+ private void OnGenericKeyAction(SceneView sceneView, Event e)
+ {
+ if (KeyMappings.EventsMatch(e, Event.KeyboardEvent(KeyMappings.Instance.ToggleMode))
+ || KeyMappings.EventsMatch(e, Event.KeyboardEvent(KeyMappings.Instance.ToggleModeBack)))
+ {
+ // Toggle mode - immediately (key down)
+ if (e.type == EventType.KeyDown)
+ {
+ int currentModeInt = (int)CurrentSettings.CurrentMode;
+ int count = Enum.GetNames(typeof(MainMode)).Length;
- if (currentModeInt >= count)
- {
- currentModeInt = 0;
- }
- else if (currentModeInt < 0)
- {
- currentModeInt = count - 1;
- }
-
- SetCurrentMode((MainMode)currentModeInt);
+ if (KeyMappings.EventsMatch(e, Event.KeyboardEvent(KeyMappings.Instance.ToggleModeBack)))
+ {
+ currentModeInt--;
+ }
+ else
+ {
+ currentModeInt++;
+ }
- SceneView.RepaintAll();
- }
- e.Use();
- }
- else if (!MouseIsHeld && KeyMappings.EventsMatch(e, Event.KeyboardEvent(KeyMappings.Instance.ActivateClipMode)))
- {
- // Activate mode - immediately (key down)
- if (e.type == EventType.KeyDown && !MouseIsHeldOrRecent)
- {
- SetCurrentMode(MainMode.Clip);
-// SetOverrideMode(OverrideMode.Clip);
+ if (currentModeInt >= count)
+ {
+ currentModeInt = 0;
+ }
+ else if (currentModeInt < 0)
+ {
+ currentModeInt = count - 1;
+ }
- SceneView.RepaintAll();
- }
- e.Use();
- }
- else if (!MouseIsHeld && KeyMappings.EventsMatch(e, Event.KeyboardEvent(KeyMappings.Instance.ActivateDrawMode)))
- {
- // Activate mode - immediately (key down)
- if (e.type == EventType.KeyDown && !MouseIsHeldOrRecent)
- {
- SetCurrentMode(MainMode.Draw);
-// SetOverrideMode(OverrideMode.Draw);
+ SetCurrentMode((MainMode)currentModeInt);
- SceneView.RepaintAll();
- }
- e.Use();
- }
- else if (!MouseIsHeld && KeyMappings.EventsMatch(e, Event.KeyboardEvent(KeyMappings.Instance.ActivateFaceMode)))
- {
- // Activate mode - immediately (key down)
- if (e.type == EventType.KeyDown && !MouseIsHeldOrRecent)
- {
- SetCurrentMode(MainMode.Face);
-// SetOverrideMode(OverrideMode.Face);
+ SceneView.RepaintAll();
+ }
+ e.Use();
+ }
+ else if (!MouseIsHeld && KeyMappings.EventsMatch(e, Event.KeyboardEvent(KeyMappings.Instance.ActivateClipMode)))
+ {
+ // Activate mode - immediately (key down)
+ if (e.type == EventType.KeyDown && !MouseIsHeldOrRecent)
+ {
+ SetCurrentMode(MainMode.Clip);
+ // SetOverrideMode(OverrideMode.Clip);
- SceneView.RepaintAll();
- }
- e.Use();
- }
- else if (!MouseIsHeld && KeyMappings.EventsMatch(e, Event.KeyboardEvent(KeyMappings.Instance.ActivateVertexMode)))
- {
- // Activate mode - immediately (key down)
- if (e.type == EventType.KeyDown && !MouseIsHeldOrRecent)
- {
- SetCurrentMode(MainMode.Vertex);
-// SetOverrideMode(OverrideMode.Vertex);
+ SceneView.RepaintAll();
+ }
+ e.Use();
+ }
+ else if (!MouseIsHeld && KeyMappings.EventsMatch(e, Event.KeyboardEvent(KeyMappings.Instance.ActivateDrawMode)))
+ {
+ // Activate mode - immediately (key down)
+ if (e.type == EventType.KeyDown && !MouseIsHeldOrRecent)
+ {
+ SetCurrentMode(MainMode.Draw);
+ // SetOverrideMode(OverrideMode.Draw);
- SceneView.RepaintAll();
- }
- e.Use();
- }
+ SceneView.RepaintAll();
+ }
+ e.Use();
+ }
+ else if (!MouseIsHeld && KeyMappings.EventsMatch(e, Event.KeyboardEvent(KeyMappings.Instance.ActivateFaceMode)))
+ {
+ // Activate mode - immediately (key down)
+ if (e.type == EventType.KeyDown && !MouseIsHeldOrRecent)
+ {
+ SetCurrentMode(MainMode.Face);
+ // SetOverrideMode(OverrideMode.Face);
+
+ SceneView.RepaintAll();
+ }
+ e.Use();
+ }
+ else if (!MouseIsHeld && KeyMappings.EventsMatch(e, Event.KeyboardEvent(KeyMappings.Instance.ActivateVertexMode)))
+ {
+ // Activate mode - immediately (key down)
+ if (e.type == EventType.KeyDown && !MouseIsHeldOrRecent)
+ {
+ SetCurrentMode(MainMode.Vertex);
+ // SetOverrideMode(OverrideMode.Vertex);
+
+ SceneView.RepaintAll();
+ }
+ e.Use();
+ }
else if (!MouseIsHeld && KeyMappings.EventsMatch(e, Event.KeyboardEvent(KeyMappings.Instance.ActivateResizeMode)))
{
if (e.type == EventType.KeyDown && !MouseIsHeldOrRecent)
@@ -748,298 +796,298 @@ private void OnGenericKeyAction(SceneView sceneView, Event e)
}
e.Use();
}
- else if (KeyMappings.EventsMatch(e, Event.KeyboardEvent(KeyMappings.Instance.IncreasePosSnapping))
- && !SabreGUIHelper.AnyControlFocussed)
- {
- if (e.type == EventType.KeyUp)
- {
- CurrentSettings.ChangePosSnapDistance(2f);
- SceneView.RepaintAll();
- }
- e.Use();
- }
- else if (KeyMappings.EventsMatch(e, Event.KeyboardEvent(KeyMappings.Instance.DecreasePosSnapping))
- && !SabreGUIHelper.AnyControlFocussed)
- {
- if (e.type == EventType.KeyUp)
- {
- CurrentSettings.ChangePosSnapDistance(.5f);
- SceneView.RepaintAll();
- }
- e.Use();
- }
- else if (KeyMappings.EventsMatch(e, Event.KeyboardEvent(KeyMappings.Instance.TogglePosSnapping))
- && !SabreGUIHelper.AnyControlFocussed)
- {
- if (e.type == EventType.KeyUp)
- {
- CurrentSettings.PositionSnappingEnabled = !CurrentSettings.PositionSnappingEnabled;
- SceneView.RepaintAll();
- }
- e.Use();
- }
- else if (KeyMappings.EventsMatch(e, Event.KeyboardEvent(KeyMappings.Instance.IncreaseAngSnapping))
- && !SabreGUIHelper.AnyControlFocussed)
- {
- if (e.type == EventType.KeyUp)
- {
- if(CurrentSettings.AngleSnapDistance >= 15)
- {
- CurrentSettings.AngleSnapDistance += 15;
- }
- else
- {
- CurrentSettings.AngleSnapDistance += 5;
- }
- SceneView.RepaintAll();
- }
- e.Use();
- }
- else if (KeyMappings.EventsMatch(e, Event.KeyboardEvent(KeyMappings.Instance.DecreaseAngSnapping))
- && !SabreGUIHelper.AnyControlFocussed)
- {
- if (e.type == EventType.KeyUp)
- {
- if(CurrentSettings.AngleSnapDistance > 15)
- {
- CurrentSettings.AngleSnapDistance -= 15;
- }
- else
- {
- CurrentSettings.AngleSnapDistance -= 5;
- }
- SceneView.RepaintAll();
- }
- e.Use();
- }
- else if (KeyMappings.EventsMatch(e, Event.KeyboardEvent(KeyMappings.Instance.ToggleAngSnapping))
- && !SabreGUIHelper.AnyControlFocussed)
- {
- if (e.type == EventType.KeyUp)
- {
- CurrentSettings.AngleSnappingEnabled = !CurrentSettings.AngleSnappingEnabled;
- SceneView.RepaintAll();
- }
- e.Use();
- }
- else if (KeyMappings.EventsMatch(e, Event.KeyboardEvent(KeyMappings.Instance.ToggleBrushesHidden))
- && !SabreGUIHelper.AnyControlFocussed)
- {
- if (e.type == EventType.KeyUp)
- {
- CurrentSettings.BrushesHidden = !CurrentSettings.BrushesHidden;
+ else if (KeyMappings.EventsMatch(e, Event.KeyboardEvent(KeyMappings.Instance.IncreasePosSnapping))
+ && !SabreGUIHelper.AnyControlFocussed)
+ {
+ if (e.type == EventType.KeyUp)
+ {
+ CurrentSettings.ChangePosSnapDistance(2f);
+ SceneView.RepaintAll();
+ }
+ e.Use();
+ }
+ else if (KeyMappings.EventsMatch(e, Event.KeyboardEvent(KeyMappings.Instance.DecreasePosSnapping))
+ && !SabreGUIHelper.AnyControlFocussed)
+ {
+ if (e.type == EventType.KeyUp)
+ {
+ CurrentSettings.ChangePosSnapDistance(.5f);
+ SceneView.RepaintAll();
+ }
+ e.Use();
+ }
+ else if (KeyMappings.EventsMatch(e, Event.KeyboardEvent(KeyMappings.Instance.TogglePosSnapping))
+ && !SabreGUIHelper.AnyControlFocussed)
+ {
+ if (e.type == EventType.KeyUp)
+ {
+ CurrentSettings.PositionSnappingEnabled = !CurrentSettings.PositionSnappingEnabled;
+ SceneView.RepaintAll();
+ }
+ e.Use();
+ }
+ else if (KeyMappings.EventsMatch(e, Event.KeyboardEvent(KeyMappings.Instance.IncreaseAngSnapping))
+ && !SabreGUIHelper.AnyControlFocussed)
+ {
+ if (e.type == EventType.KeyUp)
+ {
+ if (CurrentSettings.AngleSnapDistance >= 15)
+ {
+ CurrentSettings.AngleSnapDistance += 15;
+ }
+ else
+ {
+ CurrentSettings.AngleSnapDistance += 5;
+ }
+ SceneView.RepaintAll();
+ }
+ e.Use();
+ }
+ else if (KeyMappings.EventsMatch(e, Event.KeyboardEvent(KeyMappings.Instance.DecreaseAngSnapping))
+ && !SabreGUIHelper.AnyControlFocussed)
+ {
+ if (e.type == EventType.KeyUp)
+ {
+ if (CurrentSettings.AngleSnapDistance > 15)
+ {
+ CurrentSettings.AngleSnapDistance -= 15;
+ }
+ else
+ {
+ CurrentSettings.AngleSnapDistance -= 5;
+ }
+ SceneView.RepaintAll();
+ }
+ e.Use();
+ }
+ else if (KeyMappings.EventsMatch(e, Event.KeyboardEvent(KeyMappings.Instance.ToggleAngSnapping))
+ && !SabreGUIHelper.AnyControlFocussed)
+ {
+ if (e.type == EventType.KeyUp)
+ {
+ CurrentSettings.AngleSnappingEnabled = !CurrentSettings.AngleSnappingEnabled;
+ SceneView.RepaintAll();
+ }
+ e.Use();
+ }
+ else if (KeyMappings.EventsMatch(e, Event.KeyboardEvent(KeyMappings.Instance.ToggleBrushesHidden))
+ && !SabreGUIHelper.AnyControlFocussed)
+ {
+ if (e.type == EventType.KeyUp)
+ {
+ CurrentSettings.BrushesHidden = !CurrentSettings.BrushesHidden;
UpdateAllBrushesVisibility();
- SceneView.RepaintAll();
- }
- e.Use();
- }
- else if (KeyMappings.EventsMatch(e, Event.KeyboardEvent(KeyMappings.Instance.EnableRadialMenu))
- && !SabreGUIHelper.AnyControlFocussed)
- {
- if (e.type == EventType.KeyUp)
- {
- RadialMenu.IsActive = true;
- SceneView.RepaintAll();
- }
- e.Use();
- }
- else if(!MouseIsHeld && (KeyMappings.EventsMatch(e, Event.KeyboardEvent(KeyMappings.Instance.ChangeBrushToAdditive))
- || KeyMappings.EventsMatch(e, Event.KeyboardEvent(KeyMappings.Instance.ChangeBrushToAdditive2)))
- )
- {
- if (e.type == EventType.KeyDown && !MouseIsHeldOrRecent)
- {
- bool anyChanged = false;
-
- for (int i = 0; i < Selection.gameObjects.Length; i++)
- {
- BrushBase brushBase = Selection.gameObjects[i].GetComponent();
- if (brushBase != null)
- {
- Undo.RecordObject(brushBase, "Change Brush To Add");
- brushBase.Mode = CSGMode.Add;
- anyChanged = true;
- }
- }
- if(anyChanged)
- {
- // Need to update the icon for the csg mode in the hierarchy
- EditorApplication.RepaintHierarchyWindow();
- SceneView.RepaintAll();
- }
- }
- e.Use();
- }
- else if(!MouseIsHeld && (KeyMappings.EventsMatch(e, Event.KeyboardEvent(KeyMappings.Instance.ChangeBrushToSubtractive))
- || KeyMappings.EventsMatch(e, Event.KeyboardEvent(KeyMappings.Instance.ChangeBrushToSubtractive2)))
- )
- {
- if (e.type == EventType.KeyDown && !MouseIsHeldOrRecent)
- {
- bool anyChanged = false;
+ SceneView.RepaintAll();
+ }
+ e.Use();
+ }
+ else if (KeyMappings.EventsMatch(e, Event.KeyboardEvent(KeyMappings.Instance.EnableRadialMenu))
+ && !SabreGUIHelper.AnyControlFocussed)
+ {
+ if (e.type == EventType.KeyUp)
+ {
+ RadialMenu.IsActive = true;
+ SceneView.RepaintAll();
+ }
+ e.Use();
+ }
+ else if (!MouseIsHeld && (KeyMappings.EventsMatch(e, Event.KeyboardEvent(KeyMappings.Instance.ChangeBrushToAdditive))
+ || KeyMappings.EventsMatch(e, Event.KeyboardEvent(KeyMappings.Instance.ChangeBrushToAdditive2)))
+ )
+ {
+ if (e.type == EventType.KeyDown && !MouseIsHeldOrRecent)
+ {
+ bool anyChanged = false;
- for (int i = 0; i < Selection.gameObjects.Length; i++)
- {
- BrushBase brushBase = Selection.gameObjects[i].GetComponent();
- if (brushBase != null)
- {
- Undo.RecordObject(brushBase, "Change Brush To Subtract");
- brushBase.Mode = CSGMode.Subtract;
- anyChanged = true;
- }
- }
- if(anyChanged)
- {
- // Need to update the icon for the csg mode in the hierarchy
- EditorApplication.RepaintHierarchyWindow();
- SceneView.RepaintAll();
- }
- }
- e.Use();
- }
- else if(!MouseIsHeld && (KeyMappings.EventsMatch(e, Event.KeyboardEvent(KeyMappings.Instance.Group))
- && !SabreGUIHelper.AnyControlFocussed)
- )
- {
- if (e.type == EventType.KeyDown && !MouseIsHeldOrRecent)
- {
- TransformHelper.GroupSelection();
- }
- e.Use();
- }
- else if(!MouseIsHeld && (KeyMappings.EventsMatch(e, Event.KeyboardEvent(KeyMappings.Instance.Ungroup))
- && !SabreGUIHelper.AnyControlFocussed)
- )
- {
- if (e.type == EventType.KeyDown && !MouseIsHeldOrRecent)
- {
- TransformHelper.UngroupSelection();
- }
- e.Use();
- }
- }
+ for (int i = 0; i < Selection.gameObjects.Length; i++)
+ {
+ BrushBase brushBase = Selection.gameObjects[i].GetComponent();
+ if (brushBase != null)
+ {
+ Undo.RecordObject(brushBase, "Change Brush To Add");
+ brushBase.Mode = CSGMode.Add;
+ anyChanged = true;
+ }
+ }
+ if (anyChanged)
+ {
+ // Need to update the icon for the csg mode in the hierarchy
+ EditorApplication.RepaintHierarchyWindow();
+ SceneView.RepaintAll();
+ }
+ }
+ e.Use();
+ }
+ else if (!MouseIsHeld && (KeyMappings.EventsMatch(e, Event.KeyboardEvent(KeyMappings.Instance.ChangeBrushToSubtractive))
+ || KeyMappings.EventsMatch(e, Event.KeyboardEvent(KeyMappings.Instance.ChangeBrushToSubtractive2)))
+ )
+ {
+ if (e.type == EventType.KeyDown && !MouseIsHeldOrRecent)
+ {
+ bool anyChanged = false;
+ for (int i = 0; i < Selection.gameObjects.Length; i++)
+ {
+ BrushBase brushBase = Selection.gameObjects[i].GetComponent();
+ if (brushBase != null)
+ {
+ Undo.RecordObject(brushBase, "Change Brush To Subtract");
+ brushBase.Mode = CSGMode.Subtract;
+ anyChanged = true;
+ }
+ }
+ if (anyChanged)
+ {
+ // Need to update the icon for the csg mode in the hierarchy
+ EditorApplication.RepaintHierarchyWindow();
+ SceneView.RepaintAll();
+ }
+ }
+ e.Use();
+ }
+ else if (!MouseIsHeld && (KeyMappings.EventsMatch(e, Event.KeyboardEvent(KeyMappings.Instance.Group))
+ && !SabreGUIHelper.AnyControlFocussed)
+ )
+ {
+ if (e.type == EventType.KeyDown && !MouseIsHeldOrRecent)
+ {
+ TransformHelper.GroupSelection();
+ }
+ e.Use();
+ }
+ else if (!MouseIsHeld && (KeyMappings.EventsMatch(e, Event.KeyboardEvent(KeyMappings.Instance.Ungroup))
+ && !SabreGUIHelper.AnyControlFocussed)
+ )
+ {
+ if (e.type == EventType.KeyDown && !MouseIsHeldOrRecent)
+ {
+ TransformHelper.UngroupSelection();
+ }
+ e.Use();
+ }
+ }
#if !(UNITY_5_0 || UNITY_5_1)
- void OnSelectionChanged()
- {
+
+ private void OnSelectionChanged()
+ {
bool onlyCSGModelsSelected = true; // Does not include brushes
- bool anyCSGObjectsSelected = false; // Includes brushes and models
- bool anyNonCSGSelected = false;
+ bool anyCSGObjectsSelected = false; // Includes brushes and models
+ bool anyNonCSGSelected = false;
- List foundModels = new List();
- Dictionary> selectedBrushes = new Dictionary>();
+ List foundModels = new List();
+ Dictionary> selectedBrushes = new Dictionary>();
- for (int i = 0; i < Selection.gameObjects.Length; i++)
- {
- // Skip any selected prefabs in the project window
- if(PrefabUtility.GetPrefabParent(Selection.gameObjects[i]) == null
- && PrefabUtility.GetPrefabObject(Selection.gameObjects[i].transform) != null)
- {
- continue;
- }
+ for (int i = 0; i < Selection.gameObjects.Length; i++)
+ {
+ // Skip any selected prefabs in the project window
+ if (PrefabUtility.GetPrefabParent(Selection.gameObjects[i]) == null
+ && PrefabUtility.GetPrefabObject(Selection.gameObjects[i].transform) != null)
+ {
+ continue;
+ }
- PrimitiveBrush primitiveBrush = Selection.gameObjects[i].GetComponent();
- CSGModel csgModel = Selection.gameObjects[i].GetComponent();
+ PrimitiveBrush primitiveBrush = Selection.gameObjects[i].GetComponent();
+ CSGModel csgModel = Selection.gameObjects[i].GetComponent();
- if(csgModel == null)
+ if (csgModel == null)
{
// Something other than a CSG Model has been selected
onlyCSGModelsSelected = false;
}
- if(primitiveBrush != null)
- {
- csgModel = primitiveBrush.GetCSGModel() as CSGModel;
+ if (primitiveBrush != null)
+ {
+ csgModel = primitiveBrush.GetCSGModel() as CSGModel;
- if(csgModel != null)
- {
- if(!foundModels.Contains(csgModel))
- {
- foundModels.Add(csgModel);
- selectedBrushes[csgModel] = new List();
- }
+ if (csgModel != null)
+ {
+ if (!foundModels.Contains(csgModel))
+ {
+ foundModels.Add(csgModel);
+ selectedBrushes[csgModel] = new List();
+ }
- selectedBrushes[csgModel].Add(primitiveBrush.gameObject);
- }
- }
+ selectedBrushes[csgModel].Add(primitiveBrush.gameObject);
+ }
+ }
- if(csgModel != null) // If a CSG Model is selected, or a brush has told us about its parent CSG Model
- {
- anyCSGObjectsSelected = true;
+ if (csgModel != null) // If a CSG Model is selected, or a brush has told us about its parent CSG Model
+ {
+ anyCSGObjectsSelected = true;
- if(!foundModels.Contains(csgModel))
- {
- foundModels.Add(csgModel);
- selectedBrushes[csgModel] = new List();
- }
- }
- else // None found, try recursing up to find a CSG Model
- {
- CSGModel[] parentCSGModels = Selection.gameObjects[i].GetComponentsInParent(true);
- if(parentCSGModels.Length > 0)
- {
- csgModel = parentCSGModels[0];
-
- if(Selection.gameObjects[i].GetComponent() != null
- || Selection.gameObjects[i].GetComponent() != null)
- {
- anyNonCSGSelected = true;
- }
- else
- {
- anyCSGObjectsSelected = true;
-
- if(!foundModels.Contains(csgModel))
- {
- foundModels.Add(csgModel);
- selectedBrushes[csgModel] = new List();
- }
- }
- }
- else
- {
- anyNonCSGSelected = true;
- }
- }
- }
+ if (!foundModels.Contains(csgModel))
+ {
+ foundModels.Add(csgModel);
+ selectedBrushes[csgModel] = new List();
+ }
+ }
+ else // None found, try recursing up to find a CSG Model
+ {
+ CSGModel[] parentCSGModels = Selection.gameObjects[i].GetComponentsInParent(true);
+ if (parentCSGModels.Length > 0)
+ {
+ csgModel = parentCSGModels[0];
- if(anyCSGObjectsSelected)
- {
- CSGModel activeModel = null;
- if(foundModels.Count == 1)
- {
- if(!foundModels[0].EditMode)
- {
- foundModels[0].EditMode = true;
- }
- activeModel = foundModels[0];
- }
- else
- {
- bool anyActive = false;
+ if (Selection.gameObjects[i].GetComponent() != null
+ || Selection.gameObjects[i].GetComponent() != null)
+ {
+ anyNonCSGSelected = true;
+ }
+ else
+ {
+ anyCSGObjectsSelected = true;
- for (int i = 0; i < foundModels.Count; i++)
- {
- if(foundModels[i].EditMode)
- {
- anyActive = true;
- activeModel = foundModels[i];
- break;
- }
- }
+ if (!foundModels.Contains(csgModel))
+ {
+ foundModels.Add(csgModel);
+ selectedBrushes[csgModel] = new List();
+ }
+ }
+ }
+ else
+ {
+ anyNonCSGSelected = true;
+ }
+ }
+ }
- if(!anyActive)
- {
- foundModels[0].EditMode = true;
- activeModel = foundModels[0];
- }
- }
+ if (anyCSGObjectsSelected)
+ {
+ CSGModel activeModel = null;
+ if (foundModels.Count == 1)
+ {
+ if (!foundModels[0].EditMode)
+ {
+ foundModels[0].EditMode = true;
+ }
+ activeModel = foundModels[0];
+ }
+ else
+ {
+ bool anyActive = false;
- if(anyNonCSGSelected && activeModel != null)
- {
- deferredSelection = selectedBrushes[activeModel].ToArray();
- }
+ for (int i = 0; i < foundModels.Count; i++)
+ {
+ if (foundModels[i].EditMode)
+ {
+ anyActive = true;
+ activeModel = foundModels[i];
+ break;
+ }
+ }
+
+ if (!anyActive)
+ {
+ foundModels[0].EditMode = true;
+ activeModel = foundModels[0];
+ }
+ }
+
+ if (anyNonCSGSelected && activeModel != null)
+ {
+ deferredSelection = selectedBrushes[activeModel].ToArray();
+ }
if (this != null && this.EditMode) // Current model can be destroyed
{
@@ -1054,98 +1102,100 @@ void OnSelectionChanged()
{
SetOverrideMode(OverrideMode.None);
}
- }
+ }
}
- }
- else if(anyNonCSGSelected)
- {
- EditMode = false;
- }
+ }
+ else if (anyNonCSGSelected)
+ {
+ EditMode = false;
+ }
+ if (EditMode)
+ {
+ // Walk backwards until we find the last selected brush
+ for (int i = Selection.gameObjects.Length - 1; i >= 0; i--)
+ {
+ Brush brush = Selection.gameObjects[i].GetComponent();
- if(EditMode)
- {
- // Walk backwards until we find the last selected brush
- for (int i = Selection.gameObjects.Length-1; i >= 0; i--)
- {
- Brush brush = Selection.gameObjects[i].GetComponent();
+ if (brush != null)
+ {
+ lastSelectedBrush = brush;
+ break;
+ }
+ }
+ }
+ }
- if(brush != null)
- {
- lastSelectedBrush = brush;
- break;
- }
- }
- }
- }
#endif
- public void SetLastSelectedBrush(Brush brush)
- {
- lastSelectedBrush = brush;
- }
-
- void OnHierarchyItemGUI(int instanceID, Rect drawRect)
- {
- if(Event.current.type == EventType.ExecuteCommand)
- {
- if(Event.current.commandName == "Duplicate")
- {
- if(EditorHelper.DuplicateSelection())
- {
- Event.current.Use();
- }
- }
- }
-
- GameObject gameObject = EditorUtility.InstanceIDToObject (instanceID) as GameObject;
+ public void SetLastSelectedBrush(Brush brush)
+ {
+ lastSelectedBrush = brush;
+ }
- if(Event.current.type == EventType.DragPerform)
- {
- if(drawRect.Contains(Event.current.mousePosition))
- {
- if(gameObject != null)
- {
- OnDragDrop(gameObject);
- }
- }
- }
+ private void OnHierarchyItemGUI(int instanceID, Rect drawRect)
+ {
+ if (Event.current.type == EventType.ExecuteCommand)
+ {
+ if (Event.current.commandName == "Duplicate")
+ {
+ if (EditorHelper.DuplicateSelection())
+ {
+ Event.current.Use();
+ }
+ }
+ }
+ GameObject gameObject = EditorUtility.InstanceIDToObject(instanceID) as GameObject;
- if(gameObject != null)
- {
- BrushBase brushBase = gameObject.GetComponent();
- if(brushBase != null)
- {
- drawRect.xMax -= 2;
- drawRect.xMin = drawRect.xMax - 16;
- drawRect.height = 16;
+ if (Event.current.type == EventType.DragPerform)
+ {
+ if (drawRect.Contains(Event.current.mousePosition))
+ {
+ if (gameObject != null)
+ {
+ OnDragDrop(gameObject);
+ }
+ }
+ }
- Material iconMaterial = null;
- // Read only brushes have a greyscale icon
- if(brushBase is PrimitiveBrush)
- {
- if(((PrimitiveBrush)brushBase).IsReadOnly)
- {
- iconMaterial = SabreCSGResources.GetGreyscaleUIMaterial();
- }
- }
- if(brushBase.IsNoCSG)
- {
- Graphics.DrawTexture(drawRect, SabreCSGResources.NoCSGIconTexture, iconMaterial);
- }
- else if(brushBase.Mode == CSGMode.Add)
- {
- Graphics.DrawTexture(drawRect, SabreCSGResources.AddIconTexture, iconMaterial);
- }
- else
- {
- Graphics.DrawTexture(drawRect, SabreCSGResources.SubtractIconTexture, iconMaterial);
- }
- }
+ if (gameObject != null)
+ {
+ BrushBase brushBase = gameObject.GetComponent();
+ if (brushBase != null)
+ {
+ drawRect.xMax -= 2;
+ drawRect.xMin = drawRect.xMax - 16;
+ drawRect.height = 16;
+ Material iconMaterial = null;
+ // Read only brushes have a greyscale icon
+ if (brushBase is PrimitiveBrush)
+ {
+ if (((PrimitiveBrush)brushBase).IsReadOnly)
+ {
+ iconMaterial = SabreCSGResources.GetGreyscaleUIMaterial();
+ }
+ }
+ if (gameObject.GetComponent())
+ {
+ Graphics.DrawTexture(drawRect, SabreCSGResources.GroupIconTexture, iconMaterial);
+ }
+ else if (brushBase.IsNoCSG)
+ {
+ Graphics.DrawTexture(drawRect, SabreCSGResources.NoCSGIconTexture, iconMaterial);
+ }
+ else if (brushBase.Mode == CSGMode.Add)
+ {
+ Graphics.DrawTexture(drawRect, SabreCSGResources.AddIconTexture, iconMaterial);
+ }
+ else
+ {
+ Graphics.DrawTexture(drawRect, SabreCSGResources.SubtractIconTexture, iconMaterial);
+ }
+ }
- if(EditMode)
+ if (EditMode)
{
Event e = Event.current;
@@ -1154,159 +1204,161 @@ void OnHierarchyItemGUI(int instanceID, Rect drawRect)
OnGenericKeyAction(null, e);
}
}
- }
- }
+ }
+ }
- int frameIndex;
- void OnEditorUpdate ()
- {
- if(deferredSelection != null)
- {
- Selection.objects = deferredSelection;
- deferredSelection = null;
- SceneView.RepaintAll();
- EditorApplication.RepaintHierarchyWindow();
- }
+ private int frameIndex;
- if(EditMode)
- {
- frameIndex++;
- if(frameIndex > 1000)
- {
- frameIndex -= 1000;
- }
+ private void OnEditorUpdate()
+ {
+ if (deferredSelection != null)
+ {
+ Selection.objects = deferredSelection;
+ deferredSelection = null;
+ SceneView.RepaintAll();
+ EditorApplication.RepaintHierarchyWindow();
+ }
- if(AutoRebuild && gameObject.activeInHierarchy && this.enabled)
- {
-// if(frameIndex % 30 == 0)
- {
- Build(false, false);
- }
- }
+ if (EditMode)
+ {
+ frameIndex++;
+ if (frameIndex > 1000)
+ {
+ frameIndex -= 1000;
+ }
- if(CurrentSettings.OverrideFlyCamera)
- {
- LinearFPSCam.OnUpdate();
- }
- }
+ if (AutoRebuild && gameObject.activeInHierarchy && this.enabled)
+ {
+ // if(frameIndex % 30 == 0)
+ {
+ Build(false, false);
+ }
+ }
- if(!Application.isPlaying)
- {
- bool buildOccurred = CSGFactory.Tick();
- if(buildOccurred)
- {
- OnBuildComplete();
- }
- }
- }
+ if (CurrentSettings.OverrideFlyCamera)
+ {
+ LinearFPSCam.OnUpdate();
+ }
+ }
- protected override void Update()
- {
- if(editMode && !anyCSGModelsInEditMode)
- {
- anyCSGModelsInEditMode = true;
+ if (!Application.isPlaying)
+ {
+ bool buildOccurred = CSGFactory.Tick();
+ if (buildOccurred)
+ {
+ OnBuildComplete();
+ }
+ }
+ }
+
+ protected override void Update()
+ {
+ if (editMode && !anyCSGModelsInEditMode)
+ {
+ anyCSGModelsInEditMode = true;
UpdateAllBrushesVisibility();
- }
-
- base.Update();
+ }
- // Make sure the events we need to listen for are all bound (recompilation removes listeners, so it is
- // necessary to rebind dynamically)
- if(!EditorHelper.SceneViewHasDelegate(OnSceneGUI))
- {
- // Then resubscribe and repaint
- SceneView.onSceneGUIDelegate += OnSceneGUI;
- SceneView.RepaintAll();
- }
+ base.Update();
+
+ // Make sure the events we need to listen for are all bound (recompilation removes listeners, so it is
+ // necessary to rebind dynamically)
+ if (!EditorHelper.SceneViewHasDelegate(OnSceneGUI))
+ {
+ // Then resubscribe and repaint
+ SceneView.onSceneGUIDelegate += OnSceneGUI;
+ SceneView.RepaintAll();
+ }
#if !(UNITY_5_0 || UNITY_5_1)
- if(!EditorHelper.HasDelegate(Selection.selectionChanged, (Action)OnSelectionChanged))
- {
- Selection.selectionChanged += OnSelectionChanged;
- }
+ if (!EditorHelper.HasDelegate(Selection.selectionChanged, (Action)OnSelectionChanged))
+ {
+ Selection.selectionChanged += OnSelectionChanged;
+ // When we come out of play mode we lose this event handler and are no longer in edit mode.
+ // We call OnSelectionChanged() manually to make sure we go back into edit mode, if a brush is still selected.
+ OnSelectionChanged();
+ }
#endif
- if(!EditorHelper.HasDelegate(EditorApplication.hierarchyWindowItemOnGUI, (EditorApplication.HierarchyWindowItemCallback)OnHierarchyItemGUI))
- {
- EditorApplication.hierarchyWindowItemOnGUI += OnHierarchyItemGUI;
- }
-
- if (EditMode)
- {
- if(!EditorHelper.HasDelegate(EditorApplication.projectWindowItemOnGUI, (EditorApplication.ProjectWindowItemCallback)OnProjectItemGUI))
- {
- EditorApplication.projectWindowItemOnGUI += OnProjectItemGUI;
- }
-
-
- if(!EditorHelper.HasDelegate(EditorApplication.update, (EditorApplication.CallbackFunction)OnEditorUpdate))
- {
- EditorApplication.update += OnEditorUpdate;
- }
-
- if(!EditorHelper.HasDelegate(Undo.undoRedoPerformed, (Undo.UndoRedoCallback)OnUndoRedoPerformed))
- {
- Undo.undoRedoPerformed += OnUndoRedoPerformed;
- }
+ if (!EditorHelper.HasDelegate(EditorApplication.hierarchyWindowItemOnGUI, (EditorApplication.HierarchyWindowItemCallback)OnHierarchyItemGUI))
+ {
+ EditorApplication.hierarchyWindowItemOnGUI += OnHierarchyItemGUI;
+ }
- // Track whether all the brushes have been destroyed
- bool anyBrushes = false;
+ if (EditMode)
+ {
+ if (!EditorHelper.HasDelegate(EditorApplication.projectWindowItemOnGUI, (EditorApplication.ProjectWindowItemCallback)OnProjectItemGUI))
+ {
+ EditorApplication.projectWindowItemOnGUI += OnProjectItemGUI;
+ }
- if(brushes != null)
- {
- for (int i = 0; i < brushes.Count; i++)
- {
- if(brushes[i] != null)
- {
- anyBrushes = true;
- break;
- }
- }
- }
+ if (!EditorHelper.HasDelegate(EditorApplication.update, (EditorApplication.CallbackFunction)OnEditorUpdate))
+ {
+ EditorApplication.update += OnEditorUpdate;
+ }
- Toolbar.WarningMessage = "";
- Brush firstBrush = GetComponentInChildren();
- if(firstBrush != null)
- {
- if(firstBrush.Mode == CSGMode.Subtract)
- {
- Toolbar.WarningMessage = "First brush must be additive";
- }
- // anyBrushes = true;
- }
+ if (!EditorHelper.HasDelegate(Undo.undoRedoPerformed, (Undo.UndoRedoCallback)OnUndoRedoPerformed))
+ {
+ Undo.undoRedoPerformed += OnUndoRedoPerformed;
+ }
- // All the brushes have been destroyed so add a default cube brush
- if(!Application.isPlaying && !anyBrushes)
- {
- // Create the default brush
- //GameObject newBrushObject = CreateBrush(PrimitiveBrushType.Cube, new Vector3(0,1,0));
- //// Set the selection to the new object
- //Selection.activeGameObject = newBrushObject;
- }
- }
- }
+ // Track whether all the brushes have been destroyed
+ bool anyBrushes = false;
+ if (brushes != null)
+ {
+ for (int i = 0; i < brushes.Count; i++)
+ {
+ if (brushes[i] != null)
+ {
+ anyBrushes = true;
+ break;
+ }
+ }
+ }
- void OnDestroy()
- {
- EditorApplication.update -= OnEditorUpdate;
- EditorApplication.hierarchyWindowItemOnGUI -= OnHierarchyItemGUI;
- EditorApplication.projectWindowItemOnGUI -= OnProjectItemGUI;
- SceneView.onSceneGUIDelegate -= OnSceneGUI;
- Undo.undoRedoPerformed -= OnUndoRedoPerformed;
+ Toolbar.WarningMessage = "";
+ Brush firstBrush = GetComponentInChildren();
+ if (firstBrush != null)
+ {
+ if (firstBrush.Mode == CSGMode.Subtract)
+ {
+ Toolbar.WarningMessage = "First brush must be additive";
+ }
+ // anyBrushes = true;
+ }
- GridManager.UpdateGrid();
- }
+ // All the brushes have been destroyed so add a default cube brush
+ if (!Application.isPlaying && !anyBrushes)
+ {
+ // Create the default brush
+ //GameObject newBrushObject = CreateBrush(PrimitiveBrushType.Cube, new Vector3(0,1,0));
+ //// Set the selection to the new object
+ //Selection.activeGameObject = newBrushObject;
+ }
+ }
+ }
- public void RebindToOnSceneGUI()
- {
- // Unbind the delegate, then rebind to ensure our method gets called last
- SceneView.onSceneGUIDelegate -= OnSceneGUI;
- SceneView.onSceneGUIDelegate += OnSceneGUI;
- }
+ private void OnDestroy()
+ {
+ EditorApplication.update -= OnEditorUpdate;
+ EditorApplication.hierarchyWindowItemOnGUI -= OnHierarchyItemGUI;
+ EditorApplication.projectWindowItemOnGUI -= OnProjectItemGUI;
+ SceneView.onSceneGUIDelegate -= OnSceneGUI;
+ Undo.undoRedoPerformed -= OnUndoRedoPerformed;
- public void ExportOBJ (bool limitToSelection)
- {
+ GridManager.UpdateGrid();
+ }
+
+ public void RebindToOnSceneGUI()
+ {
+ // Unbind the delegate, then rebind to ensure our method gets called last
+ SceneView.onSceneGUIDelegate -= OnSceneGUI;
+ SceneView.onSceneGUIDelegate += OnSceneGUI;
+ }
+
+ public void ExportOBJ(bool limitToSelection)
+ {
List polygonsToExport = new List();
if (limitToSelection)
@@ -1328,7 +1380,7 @@ public void ExportOBJ (bool limitToSelection)
}
}
- if(polygonsToExport.Count > 0)
+ if (polygonsToExport.Count > 0)
{
string path = EditorUtility.SaveFilePanel("Save Geometry As OBJ", "Assets", this.name + ".obj", "obj");
if (!string.IsNullOrEmpty(path))
@@ -1352,44 +1404,44 @@ public void ExportOBJ (bool limitToSelection)
}
public static string GetSabreCSGPath()
- {
- // Find all the scripts with CSGModel in their name
- string[] guids = AssetDatabase.FindAssets("CSGModel t:Script");
+ {
+ // Find all the scripts with CSGModel in their name
+ string[] guids = AssetDatabase.FindAssets("CSGModel t:Script");
- foreach (string guid in guids)
- {
- // Find the path of the file
- string path = AssetDatabase.GUIDToAssetPath(guid);
+ foreach (string guid in guids)
+ {
+ // Find the path of the file
+ string path = AssetDatabase.GUIDToAssetPath(guid);
- string suffix = "Scripts/CSGModel.cs";
- // If it is the target file, i.e. CSGModel.cs not CSGModelInspector
- if(path.EndsWith(suffix))
- {
- // Remove the suffix, to get for example Assets/SabreCSG
- path = path.Remove(path.Length-suffix.Length, suffix.Length);
+ string suffix = "Scripts/CSGModel.cs";
+ // If it is the target file, i.e. CSGModel.cs not CSGModelInspector
+ if (path.EndsWith(suffix))
+ {
+ // Remove the suffix, to get for example Assets/SabreCSG
+ path = path.Remove(path.Length - suffix.Length, suffix.Length);
- return path;
- }
- }
+ return path;
+ }
+ }
- // None matched
- return string.Empty;
- }
+ // None matched
+ return string.Empty;
+ }
- ///
- /// Marks the Build Context associated with this CSG Model as changed
- ///
- public void SetContextDirty()
- {
- EditorHelper.SetDirty(buildContextBehaviour);
- }
+ ///
+ /// Marks the Build Context associated with this CSG Model as changed
+ ///
+ public void SetContextDirty()
+ {
+ EditorHelper.SetDirty(buildContextBehaviour);
+ }
- public void UndoRecordContext(string name)
- {
- Undo.RecordObject(buildContextBehaviour, name);
- }
+ public void UndoRecordContext(string name)
+ {
+ Undo.RecordObject(buildContextBehaviour, name);
+ }
- Tool GetActiveTool()
+ private Tool GetActiveTool()
{
if (CurrentSettings.OverrideMode != OverrideMode.None)
{
@@ -1401,158 +1453,154 @@ Tool GetActiveTool()
}
}
- private void UpdateActiveTool()
- {
- Tool lastTool = activeTool;
+ private void UpdateActiveTool()
+ {
+ Tool lastTool = activeTool;
activeTool = GetActiveTool();
- if(activeTool != lastTool)
- {
- if(lastTool != null)
- {
- lastTool.Deactivated();
- }
- activeTool.ResetTool();
- }
+ if (activeTool != lastTool)
+ {
+ if (lastTool != null)
+ {
+ lastTool.Deactivated();
+ }
+ activeTool.ResetTool();
+ }
UpdateAllBrushesVisibility();
}
- public Tool GetTool(MainMode mode)
- {
- return tools[mode];
- }
+ public Tool GetTool(MainMode mode)
+ {
+ return tools[mode];
+ }
- public void SetCurrentMode(MainMode newMode)
- {
- if(CurrentSettings.OverrideMode == OverrideMode.TransformModel)
+ public void SetCurrentMode(MainMode newMode)
+ {
+ if (CurrentSettings.OverrideMode == OverrideMode.TransformModel)
{
- // If we're leaving TransformModel
+ // If we're leaving TransformModel
bool onlyModelsSelected = true;
for (int i = 0; i < Selection.gameObjects.Length; i++)
{
- if(Selection.gameObjects[i].GetComponent() == null)
+ if (Selection.gameObjects[i].GetComponent() == null)
{
onlyModelsSelected = false;
break;
}
}
// Deselect if only CSG Models are selected
- if(onlyModelsSelected)
+ if (onlyModelsSelected)
{
Selection.activeGameObject = null;
}
}
- CurrentSettings.OverrideMode = OverrideMode.None;
+ CurrentSettings.OverrideMode = OverrideMode.None;
- CurrentSettings.CurrentMode = newMode;
+ CurrentSettings.CurrentMode = newMode;
- UpdateActiveTool();
- }
+ UpdateActiveTool();
+ }
- public void SetOverrideMode(OverrideMode newMode)
- {
- CurrentSettings.OverrideMode = newMode;
+ public void SetOverrideMode(OverrideMode newMode)
+ {
+ CurrentSettings.OverrideMode = newMode;
- UpdateActiveTool();
- }
+ UpdateActiveTool();
+ }
- public void ExitOverrideMode()
- {
- CurrentSettings.OverrideMode = OverrideMode.None;
+ public void ExitOverrideMode()
+ {
+ CurrentSettings.OverrideMode = OverrideMode.None;
- UpdateActiveTool();
- }
+ UpdateActiveTool();
+ }
- public bool EditMode
- {
- get
- {
- return this.editMode;
- }
- set
- {
- // Has edit mode changed
- if (editMode != value)
- {
- editMode = value;
+ public bool EditMode
+ {
+ get
+ {
+ return this.editMode;
+ }
+ set
+ {
+ // Has edit mode changed
+ if (editMode != value)
+ {
+ editMode = value;
editModeModel = this;
CSGModel[] csgModels = Resources.FindObjectsOfTypeAll();
- if (value == true) // Edit mode enabled
- {
- // If there are any other CSG Models in the scene, disabling their editing
- if(csgModels.Length > 1)
- {
- for (int i = 0; i < csgModels.Length; i++)
- {
- if(csgModels[i] != this)
- {
- csgModels[i].EditMode = false;
- }
- }
- }
+ if (value == true) // Edit mode enabled
+ {
+ // If there are any other CSG Models in the scene, disabling their editing
+ if (csgModels.Length > 1)
+ {
+ for (int i = 0; i < csgModels.Length; i++)
+ {
+ if (csgModels[i] != this)
+ {
+ csgModels[i].EditMode = false;
+ }
+ }
+ }
- // This CSG Model is now in edit mode, so we know for sure one is
- anyCSGModelsInEditMode = true;
+ // This CSG Model is now in edit mode, so we know for sure one is
+ anyCSGModelsInEditMode = true;
- // Bind listeners
- EditorApplication.update += OnEditorUpdate;
+ // Bind listeners
+ EditorApplication.update += OnEditorUpdate;
- // Force the scene views to repaint (shows our own UI)
- SceneView.RepaintAll();
+ // Force the scene views to repaint (shows our own UI)
+ SceneView.RepaintAll();
- // if(Event.current != null)
- // {
- // Event.current.Use();
- // }
+ // if(Event.current != null)
+ // {
+ // Event.current.Use();
+ // }
- // SceneView.onSceneGUIDelegate += OnSceneGUI;
+ // SceneView.onSceneGUIDelegate += OnSceneGUI;
+ }
+ else // Edit mode disabled
+ {
+ // Unbind listeners
+ EditorApplication.update -= OnEditorUpdate;
+ // SceneView.onSceneGUIDelegate -= OnSceneGUI;
- }
- else // Edit mode disabled
- {
- // Unbind listeners
- EditorApplication.update -= OnEditorUpdate;
-
- // SceneView.onSceneGUIDelegate -= OnSceneGUI;
-
- // Force the scene views to repaint (hides our own UI)
- SceneView.RepaintAll();
- // HandleUtility.Repaint();
-
- // This CSG Model is no longer in edit mode, so find out if any are
- anyCSGModelsInEditMode = false;
- if(csgModels.Length > 1)
- {
- for (int i = 0; i < csgModels.Length; i++)
- {
- if(csgModels[i] != this
- && csgModels[i].EditMode)
- {
+ // Force the scene views to repaint (hides our own UI)
+ SceneView.RepaintAll();
+ // HandleUtility.Repaint();
+
+ // This CSG Model is no longer in edit mode, so find out if any are
+ anyCSGModelsInEditMode = false;
+ if (csgModels.Length > 1)
+ {
+ for (int i = 0; i < csgModels.Length; i++)
+ {
+ if (csgModels[i] != this
+ && csgModels[i].EditMode)
+ {
editModeModel = csgModels[i];
- anyCSGModelsInEditMode = true;
- }
- }
- }
- }
+ anyCSGModelsInEditMode = true;
+ }
+ }
+ }
+ }
UpdateAllBrushesVisibility();
- GridManager.UpdateGrid();
- }
- }
- }
-
-
+ GridManager.UpdateGrid();
+ }
+ }
+ }
- void OnProjectItemGUI (string guid, Rect selectionRect)
- {
- // Debug.Log(Event.current.type.ToString());
- /*
+ private void OnProjectItemGUI(string guid, Rect selectionRect)
+ {
+ // Debug.Log(Event.current.type.ToString());
+ /*
if (Event.current.type == EventType.MouseDrag)
{
if(selectionRect.Contains(Event.current.mousePosition))
@@ -1565,89 +1613,91 @@ void OnProjectItemGUI (string guid, Rect selectionRect)
DragAndDrop.paths = new string[] { path };
DragAndDrop.StartDrag ("Dragging material");
-
+
// Make sure no one else uses this event
Event.current.Use();
}
}
}
*/
- }
+ }
- void OnDragDrop(GameObject gameObject)
- {
- // PrimitiveBrush brush = gameObject.GetComponent();
- //
- // if(brush != null)
- // {
- // if(DragAndDrop.objectReferences.Length == 1)
- // {
- // if(DragAndDrop.objectReferences[0] is Material)
- // {
- // brush.Material = (Material)DragAndDrop.objectReferences[0];
- // DragAndDrop.AcceptDrag();
- // Event.current.Use();
- // }
- // }
- // }
- }
+ private void OnDragDrop(GameObject gameObject)
+ {
+ // PrimitiveBrush brush = gameObject.GetComponent();
+ //
+ // if(brush != null)
+ // {
+ // if(DragAndDrop.objectReferences.Length == 1)
+ // {
+ // if(DragAndDrop.objectReferences[0] is Material)
+ // {
+ // brush.Material = (Material)DragAndDrop.objectReferences[0];
+ // DragAndDrop.AcceptDrag();
+ // Event.current.Use();
+ // }
+ // }
+ // }
+ }
- private void OnUndoRedoPerformed()
- {
- // An undo or redo operation may restore a brush, so make sure we track all
- brushes = new List(transform.GetComponentsInChildren(false));
+ private void OnUndoRedoPerformed()
+ {
+ // An undo or redo operation may restore a brush, so make sure we track all
+ brushes = new List(transform.GetComponentsInChildren(false));
- BrushBase[] brushBases = transform.GetComponentsInChildren(false);
+ BrushBase[] brushBases = transform.GetComponentsInChildren(false);
- // Tell each brush base that an undo/redo has been performed so it can make sure the render mesh is updated
- for (int i = 0; i < brushBases.Length; i++)
- {
- if(brushBases[i] != null)
- {
- brushBases[i].OnUndoRedoPerformed();
- }
- }
+ // Tell each brush base that an undo/redo has been performed so it can make sure the render mesh is updated
+ for (int i = 0; i < brushBases.Length; i++)
+ {
+ if (brushBases[i] != null)
+ {
+ brushBases[i].OnUndoRedoPerformed();
+ }
+ }
- activeTool.OnUndoRedoPerformed();
+ activeTool.OnUndoRedoPerformed();
- // If the user undos or redos a face change then a shared mesh may be updated.
- // Unity won't automatically refresh the mesh filters that use a shared mesh, so we need to force refresh
- // all of them so they fetch the latest revision of the mesh
- Transform meshGroup = GetMeshGroupTransform();
+ // If the user undos or redos a face change then a shared mesh may be updated.
+ // Unity won't automatically refresh the mesh filters that use a shared mesh, so we need to force refresh
+ // all of them so they fetch the latest revision of the mesh
+ Transform meshGroup = GetMeshGroupTransform();
- if(meshGroup != null)
- {
- MeshFilter[] meshFilters = meshGroup.GetComponentsInChildren();
- for (int i = 0; i < meshFilters.Length; i++)
- {
- meshFilters[i].ForceRefreshSharedMesh();
- }
- }
+ if (meshGroup != null)
+ {
+ MeshFilter[] meshFilters = meshGroup.GetComponentsInChildren();
+ for (int i = 0; i < meshFilters.Length; i++)
+ {
+ meshFilters[i].ForceRefreshSharedMesh();
+ }
+ }
- EditorApplication.RepaintHierarchyWindow();
- }
+ EditorApplication.RepaintHierarchyWindow();
+ }
- public override bool AreBrushesVisible {
- get {
- if(!Application.isPlaying)
- {
+ public override bool AreBrushesVisible
+ {
+ get
+ {
+ if (!Application.isPlaying)
+ {
return CurrentSettings.BrushesVisible
- && anyCSGModelsInEditMode
- && editModeModel != null
+ && anyCSGModelsInEditMode
+ && editModeModel != null
&& (editModeModel.activeTool == null || editModeModel.activeTool.BrushesHandleDrawing);
- }
- return base.AreBrushesVisible;
- }
- }
+ }
+ return base.AreBrushesVisible;
+ }
+ }
public static void UpdateAllBrushesVisibility()
{
CSGModel[] csgModels = Resources.FindObjectsOfTypeAll();
- for (int i = 0; i < csgModels.Length; i++)
+ for (int i = 0; i < csgModels.Length; i++)
{
Transform meshGroup = csgModels[i].transform.Find("MeshGroup");
- if(meshGroup != null)
+ if (meshGroup != null)
{
meshGroup.gameObject.SetActive(!CurrentSettings.MeshHidden);
}
@@ -1663,244 +1713,238 @@ public static void UpdateAllBrushesVisibility()
}
}
+ public override Material GetDefaultFallbackMaterial()
+ {
+ if (!Application.isPlaying)
+ {
+ // To allow users to move the SabreCSG folder, we must base the material loading on the asset path
+ return AssetDatabase.LoadMainAssetAtPath(GetSabreCSGPath() + "Resources/" + DEFAULT_FALLBACK_MATERIAL_PATH + ".mat") as Material;
+ }
+ else
+ {
+ return base.GetDefaultFallbackMaterial();
+ }
+ }
+ public override void OnBuildProgressChanged(float progress)
+ {
+ base.OnBuildProgressChanged(progress);
- public override Material GetDefaultFallbackMaterial ()
- {
- if(!Application.isPlaying)
- {
- // To allow users to move the SabreCSG folder, we must base the material loading on the asset path
- return AssetDatabase.LoadMainAssetAtPath(GetSabreCSGPath() + "Resources/" + DEFAULT_FALLBACK_MATERIAL_PATH + ".mat") as Material;
- }
- else
- {
- return base.GetDefaultFallbackMaterial ();
- }
- }
-
- public override void OnBuildProgressChanged (float progress)
- {
- base.OnBuildProgressChanged (progress);
-
- EditorUtility.DisplayProgressBar("Building", "Building geometry from brushes", progress);
- }
-
- private void BreakMeshTest(Mesh mesh)
- {
- Vector3[] vertices = new Vector3[mesh.triangles.Length];
- Vector3[] normals = new Vector3[mesh.triangles.Length];
- Color32[] colors32 = new Color32[mesh.triangles.Length];
- Vector2[] uvs = new Vector2[mesh.triangles.Length];
- Vector4[] tangents = new Vector4[mesh.triangles.Length];
- int[] triangles = new int[mesh.triangles.Length];
- for (int i = 0; i < mesh.triangles.Length; i++)
- {
- int oldIndex = mesh.triangles[i];
- vertices[i] = mesh.vertices[oldIndex];
- normals[i] = mesh.normals[oldIndex];
- colors32[i] = mesh.colors32[oldIndex];
- uvs[i] = mesh.uv[oldIndex];
- tangents[i] = mesh.tangents[oldIndex];
- triangles[i] = i;
- }
- mesh.vertices = vertices;
- mesh.normals = normals;
- mesh.colors32 = colors32;
- mesh.uv = uvs;
- mesh.tangents = tangents;
- mesh.triangles = triangles;
- }
-
- public override void OnFinalizeVisualMesh (GameObject newGameObject, Mesh mesh)
- {
- base.OnFinalizeVisualMesh (newGameObject, mesh);
-
- if (buildSettings.GenerateLightmapUVs)
- {
-// BreakMeshTest(mesh);
+ EditorUtility.DisplayProgressBar("Building", "Building geometry from brushes", progress);
+ }
- // Create a copy of the mesh, which we can then unwrap
- Mesh meshCopy = new Mesh();
+ private void BreakMeshTest(Mesh mesh)
+ {
+ Vector3[] vertices = new Vector3[mesh.triangles.Length];
+ Vector3[] normals = new Vector3[mesh.triangles.Length];
+ Color32[] colors32 = new Color32[mesh.triangles.Length];
+ Vector2[] uvs = new Vector2[mesh.triangles.Length];
+ Vector4[] tangents = new Vector4[mesh.triangles.Length];
+ int[] triangles = new int[mesh.triangles.Length];
+ for (int i = 0; i < mesh.triangles.Length; i++)
+ {
+ int oldIndex = mesh.triangles[i];
+ vertices[i] = mesh.vertices[oldIndex];
+ normals[i] = mesh.normals[oldIndex];
+ colors32[i] = mesh.colors32[oldIndex];
+ uvs[i] = mesh.uv[oldIndex];
+ tangents[i] = mesh.tangents[oldIndex];
+ triangles[i] = i;
+ }
+ mesh.vertices = vertices;
+ mesh.normals = normals;
+ mesh.colors32 = colors32;
+ mesh.uv = uvs;
+ mesh.tangents = tangents;
+ mesh.triangles = triangles;
+ }
- meshCopy.vertices = mesh.vertices;
- meshCopy.normals = mesh.normals;
- meshCopy.colors32 = mesh.colors32;
- meshCopy.uv = mesh.uv;
- meshCopy.tangents = mesh.tangents;
- meshCopy.triangles = mesh.triangles;
+ public override void OnFinalizeVisualMesh(GameObject newGameObject, Mesh mesh)
+ {
+ base.OnFinalizeVisualMesh(newGameObject, mesh);
- // Vector2[] perTriangleUVs = UnityEditor.Unwrapping.GeneratePerTriangleUV(meshCopy);
+ if (buildSettings.GenerateLightmapUVs)
+ {
+ // BreakMeshTest(mesh);
- UnityEditor.UnwrapParam unwrapParameters = new UnityEditor.UnwrapParam()
- {
- angleError = buildSettings.UnwrapAngleError,
- areaError = buildSettings.UnwrapAreaError,
- hardAngle = buildSettings.UnwrapHardAngle,
- packMargin = buildSettings.UnwrapPackMargin,
- };
+ // Create a copy of the mesh, which we can then unwrap
+ Mesh meshCopy = new Mesh();
- // Unwrap the mesh copy, note that this also changes the vertex buffer, which is why we do it on a copy
- UnityEditor.Unwrapping.GenerateSecondaryUVSet(meshCopy, unwrapParameters);
+ meshCopy.vertices = mesh.vertices;
+ meshCopy.normals = mesh.normals;
+ meshCopy.colors32 = mesh.colors32;
+ meshCopy.uv = mesh.uv;
+ meshCopy.tangents = mesh.tangents;
+ meshCopy.triangles = mesh.triangles;
- // Now transfer the unwrapped UVs to the original mesh, since the two vertex counts differ
- Vector2[] uv2 = new Vector2[mesh.vertices.Length];
+ // Vector2[] perTriangleUVs = UnityEditor.Unwrapping.GeneratePerTriangleUV(meshCopy);
- if(meshCopy.triangles.Length == mesh.triangles.Length)
- {
-// VisualDebug.ClearAll();
-// for (int i = 0; i < meshCopy.triangles.Length/3; i++)
-// {
-// int index1 = meshCopy.triangles[i*3 + 0];
-// int index2 = meshCopy.triangles[i*3 + 1];
-// int index3 = meshCopy.triangles[i*3 + 2];
-//// if(index1 == index2 || index2 == index3 || index1 == index3)
-//// {
-//// Debug.LogError("Degen found");
-//// }
-// VisualDebug.AddLinePolygon(new Vector3[]{
-// meshCopy.uv2[index1],
-// meshCopy.uv2[index2],
-// meshCopy.uv2[index3],
-// }, Color.white);
-// }
-
- int triangleCount = mesh.triangles.Length;
- for (int i = 0; i < triangleCount; i++)
- {
- int originalIndex = mesh.triangles[i];
- int copyIndex = meshCopy.triangles[i];
-
-// if(mesh.vertices[originalIndex] != meshCopy.vertices[copyIndex])
-// {
-// Debug.LogError("Vertex mismatch found");
-// }
-//
-// if(uv2[originalIndex] != Vector2.zero
-// && uv2[originalIndex] != meshCopy.uv2[copyIndex])
-// {
-// Debug.Log("Overwriting " + uv2[originalIndex] + " with " + meshCopy.uv2[copyIndex]);
-// }
- uv2[originalIndex] = meshCopy.uv2[copyIndex];
+ UnityEditor.UnwrapParam unwrapParameters = new UnityEditor.UnwrapParam()
+ {
+ angleError = buildSettings.UnwrapAngleError,
+ areaError = buildSettings.UnwrapAreaError,
+ hardAngle = buildSettings.UnwrapHardAngle,
+ packMargin = buildSettings.UnwrapPackMargin,
+ };
- }
+ // Unwrap the mesh copy, note that this also changes the vertex buffer, which is why we do it on a copy
+ UnityEditor.Unwrapping.GenerateSecondaryUVSet(meshCopy, unwrapParameters);
+ // Now transfer the unwrapped UVs to the original mesh, since the two vertex counts differ
+ Vector2[] uv2 = new Vector2[mesh.vertices.Length];
- mesh.uv2 = uv2;
-
-
-// for (int i = 0; i < mesh.triangles.Length/3; i++)
-// {
-// int index1 = mesh.triangles[i*3 + 0];
-// int index2 = mesh.triangles[i*3 + 1];
-// int index3 = mesh.triangles[i*3 + 2];
-//// if(index1 == index2 || index2 == index3 || index1 == index3)
-//// {
-//// Debug.LogError("Degen found");
-//// }
-// VisualDebug.AddLinePolygon(new Vector3[]{
-// mesh.uv2[index1] + Vector2.right,
-// mesh.uv2[index2] + Vector2.right,
-// mesh.uv2[index3] + Vector2.right,
-// }, Color.blue);
-// }
-// for (int i = 0; i < uv2.Length/3; i++)
-// {
-// VisualDebug.AddLinePolygon(new Vector3[]{
-// uv2[i*3 + 0] + Vector2.right,
-// uv2[i*3 + 1] + Vector2.right,
-// uv2[i*3 + 2] + Vector2.right,
-// }, Color.blue);
-// }
- }
- else
- {
- Debug.LogError("Unwrapped mesh triangle count mismatches source mesh");
- }
+ if (meshCopy.triangles.Length == mesh.triangles.Length)
+ {
+ // VisualDebug.ClearAll();
+ // for (int i = 0; i < meshCopy.triangles.Length/3; i++)
+ // {
+ // int index1 = meshCopy.triangles[i*3 + 0];
+ // int index2 = meshCopy.triangles[i*3 + 1];
+ // int index3 = meshCopy.triangles[i*3 + 2];
+ //// if(index1 == index2 || index2 == index3 || index1 == index3)
+ //// {
+ //// Debug.LogError("Degen found");
+ //// }
+ // VisualDebug.AddLinePolygon(new Vector3[]{
+ // meshCopy.uv2[index1],
+ // meshCopy.uv2[index2],
+ // meshCopy.uv2[index3],
+ // }, Color.white);
+ // }
+
+ int triangleCount = mesh.triangles.Length;
+ for (int i = 0; i < triangleCount; i++)
+ {
+ int originalIndex = mesh.triangles[i];
+ int copyIndex = meshCopy.triangles[i];
+
+ // if(mesh.vertices[originalIndex] != meshCopy.vertices[copyIndex])
+ // {
+ // Debug.LogError("Vertex mismatch found");
+ // }
+ //
+ // if(uv2[originalIndex] != Vector2.zero
+ // && uv2[originalIndex] != meshCopy.uv2[copyIndex])
+ // {
+ // Debug.Log("Overwriting " + uv2[originalIndex] + " with " + meshCopy.uv2[copyIndex]);
+ // }
+ uv2[originalIndex] = meshCopy.uv2[copyIndex];
+ }
- // GameObject.DestroyImmediate(meshCopy);
- }
+ mesh.uv2 = uv2;
+
+ // for (int i = 0; i < mesh.triangles.Length/3; i++)
+ // {
+ // int index1 = mesh.triangles[i*3 + 0];
+ // int index2 = mesh.triangles[i*3 + 1];
+ // int index3 = mesh.triangles[i*3 + 2];
+ //// if(index1 == index2 || index2 == index3 || index1 == index3)
+ //// {
+ //// Debug.LogError("Degen found");
+ //// }
+ // VisualDebug.AddLinePolygon(new Vector3[]{
+ // mesh.uv2[index1] + Vector2.right,
+ // mesh.uv2[index2] + Vector2.right,
+ // mesh.uv2[index3] + Vector2.right,
+ // }, Color.blue);
+ // }
+ // for (int i = 0; i < uv2.Length/3; i++)
+ // {
+ // VisualDebug.AddLinePolygon(new Vector3[]{
+ // uv2[i*3 + 0] + Vector2.right,
+ // uv2[i*3 + 1] + Vector2.right,
+ // uv2[i*3 + 2] + Vector2.right,
+ // }, Color.blue);
+ // }
+ }
+ else
+ {
+ Debug.LogError("Unwrapped mesh triangle count mismatches source mesh");
+ }
- // Apply the model layer, tag and appropriate static flags
- ApplyModelAttributes(newGameObject, true);
- }
+ // GameObject.DestroyImmediate(meshCopy);
+ }
- public override void OnFinalizeCollisionMesh (GameObject newGameObject, Mesh mesh)
- {
- base.OnFinalizeCollisionMesh (newGameObject, mesh);
+ // Apply the model layer, tag and appropriate static flags
+ ApplyModelAttributes(newGameObject, true);
+ }
- // Apply the model layer, tag and appropriate static flags
- ApplyModelAttributes(newGameObject, false);
- }
+ public override void OnFinalizeCollisionMesh(GameObject newGameObject, Mesh mesh)
+ {
+ base.OnFinalizeCollisionMesh(newGameObject, mesh);
+ // Apply the model layer, tag and appropriate static flags
+ ApplyModelAttributes(newGameObject, false);
+ }
- public Mesh GetMeshForMaterial(Material sourceMaterial, int fitVertices = 0)
- {
- if(materialMeshDictionary.Contains(sourceMaterial))
- {
- List mappings = materialMeshDictionary[sourceMaterial];
+ public Mesh GetMeshForMaterial(Material sourceMaterial, int fitVertices = 0)
+ {
+ if (materialMeshDictionary.Contains(sourceMaterial))
+ {
+ List mappings = materialMeshDictionary[sourceMaterial];
- Mesh lastMesh = mappings[mappings.Count-1].Mesh;
+ Mesh lastMesh = mappings[mappings.Count - 1].Mesh;
- if(lastMesh.vertices.Length + fitVertices < MESH_VERTEX_LIMIT)
- {
- return lastMesh;
- }
- }
+ if (lastMesh.vertices.Length + fitVertices < MESH_VERTEX_LIMIT)
+ {
+ return lastMesh;
+ }
+ }
- Mesh mesh = new Mesh();
+ Mesh mesh = new Mesh();
- materialMeshDictionary.Add(sourceMaterial, mesh, null);
+ materialMeshDictionary.Add(sourceMaterial, mesh, null);
- Material materialToApply = sourceMaterial;
- if(sourceMaterial == null)
- {
- materialToApply = GetDefaultMaterial();
- }
+ Material materialToApply = sourceMaterial;
+ if (sourceMaterial == null)
+ {
+ materialToApply = GetDefaultMaterial();
+ }
- GameObject newGameObject = CSGFactory.CreateMaterialMesh(this.transform, materialToApply, mesh);
+ GameObject newGameObject = CSGFactory.CreateMaterialMesh(this.transform, materialToApply, mesh);
- // Apply the model layer, tag and appropriate static flags
- ApplyModelAttributes(newGameObject, false);
+ // Apply the model layer, tag and appropriate static flags
+ ApplyModelAttributes(newGameObject, false);
- return mesh;
- }
+ return mesh;
+ }
- public Mesh GetMeshForCollision(int fitVertices = 0)
- {
- Mesh lastMesh = collisionMeshDictionary[collisionMeshDictionary.Count-1];
- if(lastMesh.vertices.Length + fitVertices < MESH_VERTEX_LIMIT)
- {
- return lastMesh;
- }
+ public Mesh GetMeshForCollision(int fitVertices = 0)
+ {
+ Mesh lastMesh = collisionMeshDictionary[collisionMeshDictionary.Count - 1];
+ if (lastMesh.vertices.Length + fitVertices < MESH_VERTEX_LIMIT)
+ {
+ return lastMesh;
+ }
- Mesh mesh = new Mesh();
- collisionMeshDictionary.Add(mesh);
- GameObject newGameObject = CSGFactory.CreateCollisionMesh(this.transform, mesh);
+ Mesh mesh = new Mesh();
+ collisionMeshDictionary.Add(mesh);
+ GameObject newGameObject = CSGFactory.CreateCollisionMesh(this.transform, mesh);
- // Apply the model layer, tag and appropriate static flags
- ApplyModelAttributes(newGameObject, false);
+ // Apply the model layer, tag and appropriate static flags
+ ApplyModelAttributes(newGameObject, false);
- return mesh;
- }
+ return mesh;
+ }
- void ApplyModelAttributes(GameObject newGameObject, bool isVisual)
- {
- // Inherit any static flags from the CSG model
- UnityEditor.StaticEditorFlags rootStaticFlags = UnityEditor.GameObjectUtility.GetStaticEditorFlags(this.gameObject);
- UnityEditor.GameObjectUtility.SetStaticEditorFlags(newGameObject, rootStaticFlags);
+ private void ApplyModelAttributes(GameObject newGameObject, bool isVisual)
+ {
+ // Inherit any static flags from the CSG model
+ UnityEditor.StaticEditorFlags rootStaticFlags = UnityEditor.GameObjectUtility.GetStaticEditorFlags(this.gameObject);
+ UnityEditor.GameObjectUtility.SetStaticEditorFlags(newGameObject, rootStaticFlags);
- // Inherit the layer and tag from the CSG model
- newGameObject.layer = this.gameObject.layer;
- newGameObject.tag = this.gameObject.tag;
+ // Inherit the layer and tag from the CSG model
+ newGameObject.layer = this.gameObject.layer;
+ newGameObject.tag = this.gameObject.tag;
- // If the mesh is lightmap UV'd then make sure the object is lightmap static
- if(buildSettings.GenerateLightmapUVs)
- {
- UnityEditor.StaticEditorFlags staticFlags = UnityEditor.GameObjectUtility.GetStaticEditorFlags(newGameObject);
- staticFlags |= UnityEditor.StaticEditorFlags.LightmapStatic;
- UnityEditor.GameObjectUtility.SetStaticEditorFlags(newGameObject, staticFlags);
- }
- }
+ // If the mesh is lightmap UV'd then make sure the object is lightmap static
+ if (buildSettings.GenerateLightmapUVs)
+ {
+ UnityEditor.StaticEditorFlags staticFlags = UnityEditor.GameObjectUtility.GetStaticEditorFlags(newGameObject);
+ staticFlags |= UnityEditor.StaticEditorFlags.LightmapStatic;
+ UnityEditor.GameObjectUtility.SetStaticEditorFlags(newGameObject, staticFlags);
+ }
+ }
public static CSGModel GetActiveCSGModel()
{
@@ -1919,28 +1963,28 @@ public static CSGModel GetActiveCSGModel()
return null;
}
- static void CleanupForBuild(Transform csgModelTransform)
- {
- Transform meshGroup = csgModelTransform.Find("MeshGroup");
- if(meshGroup != null)
- {
- // Reanchor the meshes to the parent of the CSG Model
+ private static void CleanupForBuild(Transform csgModelTransform)
+ {
+ Transform meshGroup = csgModelTransform.Find("MeshGroup");
+ if (meshGroup != null)
+ {
+ // Reanchor the meshes to the parent of the CSG Model
meshGroup.SetParent(csgModelTransform.parent, true);
- }
+ }
- // Remove the CSG Model and its brushes
- DestroyImmediate (csgModelTransform.gameObject);
- }
+ // Remove the CSG Model and its brushes
+ DestroyImmediate(csgModelTransform.gameObject);
+ }
- [PostProcessScene(1)]
- public static void OnPostProcessScene()
- {
+ [PostProcessScene(1)]
+ public static void OnPostProcessScene()
+ {
CSGModel[] csgModels = Resources.FindObjectsOfTypeAll();
- for (int i = 0; i < csgModels.Length; i++)
- {
- CleanupForBuild(csgModels[i].transform);
- }
- }
+ for (int i = 0; i < csgModels.Length; i++)
+ {
+ CleanupForBuild(csgModels[i].transform);
+ }
+ }
#if UNITY_EDITOR && (UNITY_5_0 || UNITY_5_1)
void OnDrawGizmosSelected()
@@ -1951,6 +1995,7 @@ void OnDrawGizmosSelected()
}
#endif
#endif
- }
+ }
}
+
#endif
\ No newline at end of file
diff --git a/Scripts/CSGModelBase.cs b/Scripts/CSGModelBase.cs
index 9ba04c2a..00d4468c 100644
--- a/Scripts/CSGModelBase.cs
+++ b/Scripts/CSGModelBase.cs
@@ -9,309 +9,342 @@
namespace Sabresaurus.SabreCSG
{
- ///
- /// Base class for CSG Model, can be used on its own for run-time deployed CSG
- ///
-// [ExecuteInEditMode]
- public class CSGModelBase : MonoBehaviour
- {
- public const string VERSION_STRING = "1.5.1";
- protected const string DEFAULT_FALLBACK_MATERIAL_PATH = "Materials/Default_Map";
-
- // Limit to how many vertices a Unity mesh can hold, before it must be split into a second mesh (just under 2^16)
- protected const int MESH_VERTEX_LIMIT = 65500;
-
- [SerializeField,HideInInspector]
- protected List brushes = new List(); // Store the sequence of brushes and their operation (e.g. add, subtract)
-
- [SerializeField,HideInInspector]
- protected List builtBrushes = new List();
-
- [SerializeField,HideInInspector]
- protected MaterialMeshDictionary materialMeshDictionary = new MaterialMeshDictionary();
-
- [SerializeField,HideInInspector]
- protected List collisionMeshDictionary = new List();
-
- // An additional hint to the builder to tell it rebuilding is required
- [SerializeField,HideInInspector]
- protected bool polygonsRemoved = false;
-
- [SerializeField,HideInInspector]
- protected CSGBuildSettings buildSettings = new CSGBuildSettings();
-
- [SerializeField,HideInInspector]
- protected CSGBuildSettings lastBuildSettings = new CSGBuildSettings();
-
- [NonSerialized]
- protected CSGBuildContext buildContextBehaviour;
-
- // A reference to a component which holds a lot of build time data that helps change built geometry on the fly
- // This is used by the surface tools heavily.
- [NonSerialized]
- protected CSGBuildContext.BuildContext buildContext;
-
- public CSGBuildContext.BuildContext BuildContext
- {
- get
- {
- if(buildContext == null)
- {
- SetUpBuildContext();
- }
- return buildContext;
- }
- }
-
- public BuildMetrics BuildMetrics
- {
- get
- {
- return BuildContext.buildMetrics;
- }
- }
-
- public int BrushCount
- {
- get
- {
- int brushCount = 0;
- for (int i = 0; i < brushes.Count; i++)
- {
- if(brushes[i] != null)
- {
- brushCount++;
- }
- }
- return brushCount;
- }
- }
-
-
- public PolygonEntry GetVisualPolygonEntry(int index)
- {
- int entryCount = BuildContext.VisualPolygonIndex.Length;
-
- if(entryCount == 0 || index >= entryCount || index < 0)
- {
- // Return null if no polygons have been built or the index is out of range
- return null;
- }
- else
- {
- return BuildContext.VisualPolygonIndex[index];
- }
- }
-
- public PolygonEntry GetCollisionPolygonEntry(int index)
- {
- int entryCount = BuildContext.CollisionPolygonIndex.Length;
-
- if(entryCount == 0 || index >= entryCount || index < 0)
- {
- // Return null if no polygons have been built or the index is out of range
- return null;
- }
- else
- {
- return BuildContext.CollisionPolygonIndex[index];
- }
- }
-
- public bool LastBuildHadTangents
- {
- get
- {
- return lastBuildSettings.GenerateTangents;
- }
- }
-
- ///
- /// Get the list of brushes the CSG Model knows about
- ///
- /// List of brushes.
- public List GetBrushes()
- {
- return brushes;
- }
-
- void Awake()
- {
- SetUpBuildContext();
- }
-
- void SetUpBuildContext()
- {
- // Get a reference to the build context (which holds post build helper data)
- buildContextBehaviour = this.AddOrGetComponent();
- buildContext = buildContextBehaviour.GetBuildContext();
- }
-
- protected virtual void Start()
- {
- }
-
- protected virtual void Update()
- {
- if(Application.isPlaying)
- {
- bool buildOccurred = CSGFactory.Tick();
- if(buildOccurred)
- {
- OnBuildComplete();
- }
- }
- }
-
- ///
- /// Builds the brushes into final meshes
- ///
- /// If set to true all brushes will be built and cached data ignored, otherwise SabreCSG will only rebuild brushes it knows have changed
- /// If set to true the majority of the build will occur in a background thread
- public virtual void Build (bool forceRebuild, bool buildInBackground)
- {
- // If any of the build settings have changed, force all brushes to rebuild
- if(!lastBuildSettings.IsBuilt || CSGBuildSettings.AreDifferent(buildSettings, lastBuildSettings))
- {
- forceRebuild = true;
- }
-
- // Make sure we have the most accurate list of brushes, ignoring inactive objects
- brushes = new List(transform.GetComponentsInChildren(false));
-
- // Let each brush know it's about to be built
- for (int i = 0; i < brushes.Count; i++)
- {
- brushes[i].PrepareToBuild(brushes, forceRebuild);
- }
-
- // Perform a check to make sure the default material is OK
- Material defaultMaterial = GetDefaultMaterial();
-
- if(defaultMaterial == null)
- {
- Debug.LogError("Default fallback material file is missing, try reimporting SabreCSG");
- }
-
- BuildStatus buildStatus = CSGFactory.Build(brushes,
- buildSettings,
- buildContext,
- this.transform,
- materialMeshDictionary,
- collisionMeshDictionary,
- polygonsRemoved,
- forceRebuild,
- OnBuildProgressChanged,
- OnFinalizeVisualMesh,
- OnFinalizeCollisionMesh,
- buildInBackground);
-
- if(buildStatus == BuildStatus.Complete)
- {
- OnBuildComplete();
- }
- }
-
- public virtual void OnBuildComplete()
- {
- polygonsRemoved = false;
-
- // Mark the brushes that have been built (so we can differentiate later if new brushes are built or not)
- builtBrushes.Clear();
- builtBrushes.AddRange(brushes);
-
- // Copy the last build settings, so that we can make minor changes to built meshes that are consistent
- // with how they were built. E.g. maintaining tangents as appropriate
- lastBuildSettings = buildSettings.ShallowCopy();
- lastBuildSettings.IsBuilt = true; // Make it clear that the lastBuildSettings refers to a completed build
-
- // Fire any post process build events
- FirePostBuildEvents();
- }
-
-
- void FirePostBuildEvents()
- {
- Transform meshGroupTransform = GetMeshGroupTransform();
-
- // Inform all methods with the PostProcessCSGBuildAttribute that a build just finished
- Assembly[] allAssemblies = AppDomain.CurrentDomain.GetAssemblies();
- foreach (Assembly assembly in allAssemblies)
- {
- if(assembly.FullName.StartsWith("Assembly-CSharp"))
- {
- Type[] types = assembly.GetTypes();
-
- for (int i = 0; i < types.Length; i++)
- {
- MethodInfo[] methods = types[i].GetMethods(BindingFlags.Static | BindingFlags.NonPublic | BindingFlags.Public);
- for (int j = 0; j < methods.Length; j++)
- {
- if(Attribute.IsDefined(methods[j], typeof(PostProcessCSGBuildAttribute)))
- {
- methods[j].Invoke(null, new object[] { meshGroupTransform } );
- }
- }
- }
- }
- }
-
- // Inform all the scripts implementing IPostBuildListener on this model and inside it that a build finished
- IPostBuildListener[] postBuildListeners = this.transform.GetComponentsInChildren();
-
- for (int i = 0; i < postBuildListeners.Length; i++)
- {
- postBuildListeners[i].OnBuildFinished(meshGroupTransform);
- }
- }
-
- ///
- /// Called to alert the CSG Model that a new brush has been created
- ///
- public bool TrackBrush(Brush brush)
- {
- // If we don't already know about the brush, add it
- if (!brushes.Contains(brush))
- {
- brushes.Add(brush);
- return true;
- }
- else
- {
- return false;
- }
- }
-
- public void OnBrushDisabled(PrimitiveBrush brush)
- {
- polygonsRemoved = true;
- }
-
- public virtual bool AreBrushesVisible
- {
- get
- {
- return false;
- }
- }
-
- public Polygon RaycastBuiltPolygons(Ray ray)
- {
- if(BuildContext.VisualPolygons != null)
- {
- float distance = 0;
- return GeometryHelper.RaycastPolygons(BuildContext.VisualPolygons, ray, out distance);
- }
- else
- {
- return null;
- }
- }
+ ///
+ /// Base class for CSG Model, can be used on its own for run-time deployed CSG
+ ///
+ // [ExecuteInEditMode]
+ public class CSGModelBase : MonoBehaviour
+ {
+ public const string VERSION_STRING = "1.6.3";
+ protected const string DEFAULT_FALLBACK_MATERIAL_PATH = "Materials/Default_Map";
+
+ // Limit to how many vertices a Unity mesh can hold, before it must be split into a second mesh (just under 2^16)
+ protected const int MESH_VERTEX_LIMIT = 65500;
+
+ [SerializeField, HideInInspector]
+ protected List brushes = new List(); // Store the sequence of brushes and their operation (e.g. add, subtract)
+
+ [SerializeField, HideInInspector]
+ protected List builtBrushes = new List();
+
+ [SerializeField, HideInInspector]
+ protected MaterialMeshDictionary materialMeshDictionary = new MaterialMeshDictionary();
+
+ [SerializeField, HideInInspector]
+ protected List collisionMeshDictionary = new List();
+
+ // An additional hint to the builder to tell it rebuilding is required
+ [SerializeField, HideInInspector]
+ protected bool polygonsRemoved = false;
+
+ [SerializeField, HideInInspector]
+ protected CSGBuildSettings buildSettings = new CSGBuildSettings();
+
+ [SerializeField, HideInInspector]
+ protected CSGBuildSettings lastBuildSettings = new CSGBuildSettings();
+
+ [NonSerialized]
+ protected CSGBuildContext buildContextBehaviour;
+
+ // A reference to a component which holds a lot of build time data that helps change built geometry on the fly
+ // This is used by the surface tools heavily.
+ [NonSerialized]
+ protected CSGBuildContext.BuildContext buildContext;
+
+ public CSGBuildContext.BuildContext BuildContext
+ {
+ get
+ {
+ if (buildContext == null)
+ {
+ SetUpBuildContext();
+ }
+ return buildContext;
+ }
+ }
+
+ ///
+ /// The internal update counter to determine whether a large update is currently happening.
+ /// This is a hack! It does not fix the underlying cause of a too slow tracking method!
+ ///
+ private int updateCounter = 0;
+
+ ///
+ /// Begin a very large and extreme scene update where you plan to add hundreds of brushes.
+ /// This will skip several (usually important) methods related to brush tracking until the
+ /// update has completed to prevent exponential slowdown.
+ /// This is a hack! It does not fix the underlying cause of a too slow tracking method!
+ ///
+ internal void BeginUpdate()
+ {
+ updateCounter++;
+ }
+
+ ///
+ /// Ends a very large and extreme scene update where several hundred brushes were added to the scene.
+ /// This is a hack! It does not fix the underlying cause of a too slow tracking method!
+ ///
+ internal void EndUpdate()
+ {
+ updateCounter--;
+ if (updateCounter < 0) updateCounter = 0;
+ // todo: it seems the update call in new primitive brushes tracks them for us. this works with level importers but perhaps not in all cases.
+ }
+
+ ///
+ /// Gets a value indicating whether a very large scene update is currently occuring.
+ /// This is a hack! It does not fix the underlying cause of a too slow tracking method!
+ ///
+ /// true if there is a large scene update in progress; otherwise, false.
+ internal bool IsUpdating { get { return updateCounter > 0; } }
+
+ public BuildMetrics BuildMetrics
+ {
+ get
+ {
+ return BuildContext.buildMetrics;
+ }
+ }
+
+ public int BrushCount
+ {
+ get
+ {
+ int brushCount = 0;
+ for (int i = 0; i < brushes.Count; i++)
+ {
+ if (brushes[i] != null)
+ {
+ brushCount++;
+ }
+ }
+ return brushCount;
+ }
+ }
+
+ public PolygonEntry GetVisualPolygonEntry(int index)
+ {
+ int entryCount = BuildContext.VisualPolygonIndex.Length;
+
+ if (entryCount == 0 || index >= entryCount || index < 0)
+ {
+ // Return null if no polygons have been built or the index is out of range
+ return null;
+ }
+ else
+ {
+ return BuildContext.VisualPolygonIndex[index];
+ }
+ }
+
+ public PolygonEntry GetCollisionPolygonEntry(int index)
+ {
+ int entryCount = BuildContext.CollisionPolygonIndex.Length;
+
+ if (entryCount == 0 || index >= entryCount || index < 0)
+ {
+ // Return null if no polygons have been built or the index is out of range
+ return null;
+ }
+ else
+ {
+ return BuildContext.CollisionPolygonIndex[index];
+ }
+ }
+
+ public bool LastBuildHadTangents
+ {
+ get
+ {
+ return lastBuildSettings.GenerateTangents;
+ }
+ }
+
+ ///
+ /// Get the list of brushes the CSG Model knows about
+ ///
+ /// List of brushes.
+ public List GetBrushes()
+ {
+ return brushes;
+ }
+
+ private void Awake()
+ {
+ SetUpBuildContext();
+ }
+
+ private void SetUpBuildContext()
+ {
+ // Get a reference to the build context (which holds post build helper data)
+ buildContextBehaviour = this.AddOrGetComponent();
+ buildContext = buildContextBehaviour.GetBuildContext();
+ }
+
+ protected virtual void Start()
+ {
+ }
+
+ protected virtual void Update()
+ {
+ if (Application.isPlaying)
+ {
+ bool buildOccurred = CSGFactory.Tick();
+ if (buildOccurred)
+ {
+ OnBuildComplete();
+ }
+ }
+ }
+
+ ///
+ /// Builds the brushes into final meshes
+ ///
+ /// If set to true all brushes will be built and cached data ignored, otherwise SabreCSG will only rebuild brushes it knows have changed
+ /// If set to true the majority of the build will occur in a background thread
+ public virtual void Build(bool forceRebuild, bool buildInBackground)
+ {
+ // If any of the build settings have changed, force all brushes to rebuild
+ if (!lastBuildSettings.IsBuilt || CSGBuildSettings.AreDifferent(buildSettings, lastBuildSettings))
+ {
+ forceRebuild = true;
+ }
+
+ // Make sure we have the most accurate list of brushes, ignoring inactive objects
+ brushes = new List(transform.GetComponentsInChildren(false));
+
+ // Let each brush know it's about to be built
+ for (int i = 0; i < brushes.Count; i++)
+ {
+ brushes[i].PrepareToBuild(brushes, forceRebuild);
+ }
+
+ // Perform a check to make sure the default material is OK
+ Material defaultMaterial = GetDefaultMaterial();
+
+ if (defaultMaterial == null)
+ {
+ Debug.LogError("Default fallback material file is missing, try reimporting SabreCSG");
+ }
+
+ BuildStatus buildStatus = CSGFactory.Build(brushes,
+ buildSettings,
+ buildContext,
+ this.transform,
+ materialMeshDictionary,
+ collisionMeshDictionary,
+ polygonsRemoved,
+ forceRebuild,
+ OnBuildProgressChanged,
+ OnFinalizeVisualMesh,
+ OnFinalizeCollisionMesh,
+ buildInBackground);
+
+ if (buildStatus == BuildStatus.Complete)
+ {
+ OnBuildComplete();
+ }
+ }
+
+ public virtual void OnBuildComplete()
+ {
+ polygonsRemoved = false;
+
+ // Mark the brushes that have been built (so we can differentiate later if new brushes are built or not)
+ builtBrushes.Clear();
+ builtBrushes.AddRange(brushes);
+
+ // Copy the last build settings, so that we can make minor changes to built meshes that are consistent
+ // with how they were built. E.g. maintaining tangents as appropriate
+ lastBuildSettings = buildSettings.ShallowCopy();
+ lastBuildSettings.IsBuilt = true; // Make it clear that the lastBuildSettings refers to a completed build
+
+ // Fire any post process build events
+ FirePostBuildEvents();
+ }
+
+ private void FirePostBuildEvents()
+ {
+ Transform meshGroupTransform = GetMeshGroupTransform();
+
+ // Inform all methods with the PostProcessCSGBuildAttribute that a build just finished
+ Assembly[] allAssemblies = AppDomain.CurrentDomain.GetAssemblies();
+ foreach (Assembly assembly in allAssemblies)
+ {
+ if (assembly.FullName.StartsWith("Assembly-CSharp"))
+ {
+ Type[] types = assembly.GetTypes();
+
+ for (int i = 0; i < types.Length; i++)
+ {
+ MethodInfo[] methods = types[i].GetMethods(BindingFlags.Static | BindingFlags.NonPublic | BindingFlags.Public);
+ for (int j = 0; j < methods.Length; j++)
+ {
+ if (Attribute.IsDefined(methods[j], typeof(PostProcessCSGBuildAttribute)))
+ {
+ methods[j].Invoke(null, new object[] { meshGroupTransform });
+ }
+ }
+ }
+ }
+ }
+
+ // Inform all the scripts implementing IPostBuildListener on this model and inside it that a build finished
+ IPostBuildListener[] postBuildListeners = this.transform.GetComponentsInChildren();
+
+ for (int i = 0; i < postBuildListeners.Length; i++)
+ {
+ postBuildListeners[i].OnBuildFinished(meshGroupTransform);
+ }
+ }
+
+ ///
+ /// Called to alert the CSG Model that a new brush has been created
+ ///
+ public bool TrackBrush(Brush brush)
+ {
+ // If we don't already know about the brush, add it
+ if (!brushes.Contains(brush))
+ {
+ brushes.Add(brush);
+ return true;
+ }
+ else
+ {
+ return false;
+ }
+ }
+
+ public void OnBrushDisabled(PrimitiveBrush brush)
+ {
+ polygonsRemoved = true;
+ }
+
+ public virtual bool AreBrushesVisible
+ {
+ get
+ {
+ return false;
+ }
+ }
+
+ public Polygon RaycastBuiltPolygons(Ray ray)
+ {
+ if (BuildContext.VisualPolygons != null)
+ {
+ float distance = 0;
+ return GeometryHelper.RaycastPolygons(BuildContext.VisualPolygons, ray, out distance);
+ }
+ else
+ {
+ return null;
+ }
+ }
public List RaycastBuiltPolygonsAll(Ray ray)
{
if (BuildContext.VisualPolygons != null)
- {
+ {
return GeometryHelper.RaycastPolygonsAll(BuildContext.VisualPolygons, ray);
}
else
@@ -321,162 +354,162 @@ public List RaycastBuiltPolygonsAll(Ray ray)
}
public Brush FindBrushFromPolygon(Polygon sourcePolygon)
- {
- // Find which brush contains the source polygon
- for (int i = 0; i < brushes.Count; i++)
- {
- if(brushes[i] != null)
- {
- if(Array.IndexOf(brushes[i].GetPolygonIDs(), sourcePolygon.UniqueIndex) != -1)
- {
- return brushes[i];
- }
- }
- }
-
- // None found
- return null;
- }
-
- // Consider getting rid of this accessor!
- public List VisualPolygons
- {
- get
- {
- return BuildContext.VisualPolygons;
- }
- }
-
- public List GetAllSourcePolygons()
- {
- // Find the source polygon unique indexes of all the visual polygons
- List visualPolygons = BuildContext.VisualPolygons;
- List visualPolygonIndexes = new List();
-
- for (int i = 0; i < visualPolygons.Count; i++)
- {
- if(!visualPolygonIndexes.Contains(visualPolygons[i].UniqueIndex))
- {
- visualPolygonIndexes.Add(visualPolygons[i].UniqueIndex);
- }
- }
-
- List sourcePolygons = new List(visualPolygonIndexes.Count);
-
- for (int i = 0; i < visualPolygonIndexes.Count; i++)
- {
- Polygon sourcePolygon = GetSourcePolygon(visualPolygonIndexes[i]);
- sourcePolygons.Add(sourcePolygon);
- }
- return sourcePolygons;
- }
-
- public Polygon[] BuiltPolygonsByIndex(int uniquePolygonIndex)
- {
-// if(CurrentSettings.NewBuildEngine)
-// {
-// // TODO: Optimise this once Nova 1 is removed
-// List foundPolygons = new List();
-// for (int i = 0; i < brushes.Count; i++)
-// {
-// if(brushes[i] != null)
-// {
-// List brushPolygons = brushes[i].BrushCache.BuiltPolygons;
-// for (int j = 0; j < brushPolygons.Count; j++)
-// {
-// if(brushPolygons[j].UniqueIndex == uniquePolygonIndex)
-// {
-// foundPolygons.Add(brushPolygons[j]);
-// }
-// }
-// }
-// }
-// return foundPolygons.ToArray();
-// }
-// else
- {
- if(BuildContext == null || BuildContext.VisualPolygons == null)
- {
- return new Polygon[0];
- }
-
- List matchedPolygons = new List();
-
- // Match all the polygons with the same index that are built
- for (int i = 0; i < BuildContext.VisualPolygons.Count; i++)
- {
- Polygon poly = BuildContext.VisualPolygons[i];
-
- if(poly.UniqueIndex == uniquePolygonIndex && !poly.ExcludeFromFinal)
- {
- matchedPolygons.Add(poly);
- }
- }
-
- return matchedPolygons.ToArray();
- }
- }
-
-// public Polygon[] BuiltCollisionPolygonsByIndex(int uniquePolygonIndex)
-// {
-// if(buildContext == null || buildContext.collisionPolygons == null)
-// {
-// return new Polygon[0];
-// }
-//
-// return buildContext.collisionPolygons.Where(poly => (poly.UniqueIndex == uniquePolygonIndex && !poly.ExcludeFromFinal)).ToArray();
-// }
-
- public List RaycastBrushesAll(Ray ray, bool testAllModels)
- {
- List hits = new List();
-
- List brushesToTest;
-
- if(testAllModels)
- {
- brushesToTest = new List();
- CSGModelBase[] csgModels = FindObjectsOfType();
- for (int i = 0; i < csgModels.Length; i++)
- {
- brushesToTest.AddRange(csgModels[i].brushes);
- }
- }
- else
- {
- brushesToTest = brushes;
- }
-
- for (int i = 0; i < brushesToTest.Count; i++)
- {
- if(brushesToTest[i] == null)
- {
- continue;
- }
-// Bounds bounds = brushes[i].GetBoundsTransformed();
-// if(bounds.IntersectRay(ray))
- {
- Polygon[] polygons = brushesToTest[i].GenerateTransformedPolygons();
- float hitDistance;
- Polygon hitPolygon = GeometryHelper.RaycastPolygons(new List(polygons), ray, out hitDistance);
- if(hitPolygon != null)
- {
- hits.Add(new PolygonRaycastHit()
- {
- Distance = hitDistance,
- Point = ray.GetPoint(hitDistance),
- Normal = hitPolygon.Plane.normal,
- GameObject = brushesToTest[i].gameObject,
- Polygon = hitPolygon,
- }
- );
- }
- }
- }
-
- hits.Sort((x,y) => x.Distance.CompareTo(y.Distance));
- return hits;
- }
+ {
+ // Find which brush contains the source polygon
+ for (int i = 0; i < brushes.Count; i++)
+ {
+ if (brushes[i] != null)
+ {
+ if (Array.IndexOf(brushes[i].GetPolygonIDs(), sourcePolygon.UniqueIndex) != -1)
+ {
+ return brushes[i];
+ }
+ }
+ }
+
+ // None found
+ return null;
+ }
+
+ // Consider getting rid of this accessor!
+ public List VisualPolygons
+ {
+ get
+ {
+ return BuildContext.VisualPolygons;
+ }
+ }
+
+ public List GetAllSourcePolygons()
+ {
+ // Find the source polygon unique indexes of all the visual polygons
+ List visualPolygons = BuildContext.VisualPolygons;
+ List visualPolygonIndexes = new List();
+
+ for (int i = 0; i < visualPolygons.Count; i++)
+ {
+ if (!visualPolygonIndexes.Contains(visualPolygons[i].UniqueIndex))
+ {
+ visualPolygonIndexes.Add(visualPolygons[i].UniqueIndex);
+ }
+ }
+
+ List sourcePolygons = new List(visualPolygonIndexes.Count);
+
+ for (int i = 0; i < visualPolygonIndexes.Count; i++)
+ {
+ Polygon sourcePolygon = GetSourcePolygon(visualPolygonIndexes[i]);
+ sourcePolygons.Add(sourcePolygon);
+ }
+ return sourcePolygons;
+ }
+
+ public Polygon[] BuiltPolygonsByIndex(int uniquePolygonIndex)
+ {
+ // if(CurrentSettings.NewBuildEngine)
+ // {
+ // // TODO: Optimise this once Nova 1 is removed
+ // List foundPolygons = new List();
+ // for (int i = 0; i < brushes.Count; i++)
+ // {
+ // if(brushes[i] != null)
+ // {
+ // List brushPolygons = brushes[i].BrushCache.BuiltPolygons;
+ // for (int j = 0; j < brushPolygons.Count; j++)
+ // {
+ // if(brushPolygons[j].UniqueIndex == uniquePolygonIndex)
+ // {
+ // foundPolygons.Add(brushPolygons[j]);
+ // }
+ // }
+ // }
+ // }
+ // return foundPolygons.ToArray();
+ // }
+ // else
+ {
+ if (BuildContext == null || BuildContext.VisualPolygons == null)
+ {
+ return new Polygon[0];
+ }
+
+ List matchedPolygons = new List();
+
+ // Match all the polygons with the same index that are built
+ for (int i = 0; i < BuildContext.VisualPolygons.Count; i++)
+ {
+ Polygon poly = BuildContext.VisualPolygons[i];
+
+ if (poly.UniqueIndex == uniquePolygonIndex && !poly.ExcludeFromFinal)
+ {
+ matchedPolygons.Add(poly);
+ }
+ }
+
+ return matchedPolygons.ToArray();
+ }
+ }
+
+ // public Polygon[] BuiltCollisionPolygonsByIndex(int uniquePolygonIndex)
+ // {
+ // if(buildContext == null || buildContext.collisionPolygons == null)
+ // {
+ // return new Polygon[0];
+ // }
+ //
+ // return buildContext.collisionPolygons.Where(poly => (poly.UniqueIndex == uniquePolygonIndex && !poly.ExcludeFromFinal)).ToArray();
+ // }
+
+ public List RaycastBrushesAll(Ray ray, bool testAllModels)
+ {
+ List hits = new List();
+
+ List brushesToTest;
+
+ if (testAllModels)
+ {
+ brushesToTest = new List();
+ CSGModelBase[] csgModels = FindObjectsOfType();
+ for (int i = 0; i < csgModels.Length; i++)
+ {
+ brushesToTest.AddRange(csgModels[i].brushes);
+ }
+ }
+ else
+ {
+ brushesToTest = brushes;
+ }
+
+ for (int i = 0; i < brushesToTest.Count; i++)
+ {
+ if (brushesToTest[i] == null)
+ {
+ continue;
+ }
+ // Bounds bounds = brushes[i].GetBoundsTransformed();
+ // if(bounds.IntersectRay(ray))
+ {
+ Polygon[] polygons = brushesToTest[i].GenerateTransformedPolygons();
+ float hitDistance;
+ Polygon hitPolygon = GeometryHelper.RaycastPolygons(new List(polygons), ray, out hitDistance);
+ if (hitPolygon != null)
+ {
+ hits.Add(new PolygonRaycastHit()
+ {
+ Distance = hitDistance,
+ Point = ray.GetPoint(hitDistance),
+ Normal = hitPolygon.Plane.normal,
+ GameObject = brushesToTest[i].gameObject,
+ Polygon = hitPolygon,
+ }
+ );
+ }
+ }
+ }
+
+ hits.Sort((x, y) => x.Distance.CompareTo(y.Distance));
+ return hits;
+ }
public List ExtractBrushBases(List sourceBrushes)
{
@@ -484,14 +517,28 @@ public List ExtractBrushBases(List sourceBrushes)
List brushBases = new List();
for (int i = 0; i < sourceBrushes.Count; i++)
{
- if(sourceBrushes[i].GetType() == typeof(PrimitiveBrush))
+ if (sourceBrushes[i].GetType() == typeof(PrimitiveBrush))
{
+ // Get any group this brush is a child of.
+ GroupBrush group = null;
+ if (sourceBrushes[i].transform.parent)
+ group = sourceBrushes[i].transform.parent.GetComponent();
+
// Get any controller (e.g. compound brush) that is driving the selected brush
BrushBase controller = ((PrimitiveBrush)sourceBrushes[i]).BrushController;
- if (controller != null)
+
+ if (group != null)
+ {
+ // Group with 'always select group' found, add it instead if it's not already in the list
+ if (!brushBases.Contains(group))
+ {
+ brushBases.Add(group);
+ }
+ }
+ else if (controller != null)
{
// Controller found, add it instead if it's not already in the list
- if(!brushBases.Contains(controller))
+ if (!brushBases.Contains(controller))
{
brushBases.Add(controller);
}
@@ -511,50 +558,51 @@ public List ExtractBrushBases(List sourceBrushes)
return brushBases;
}
- public bool HasBrushBeenBuilt(Brush candidateBrush)
- {
- return builtBrushes.Contains(candidateBrush);
- }
-
- ///
- /// Creates a brush under the CSG Model with the specified attributes.
- ///
- /// The created game object.
- /// Brush type.
- /// Local position of the brush's transform
- /// Local bounds size of the brush (Optional, defaults to 2,2,2).
- /// Local rotation of the brush (Optional, defaults to identity quaternion).
- /// Material to apply to all faces, (Optional, defaults to null for default material).
- /// Whether the brush is additive or subtractive (Optional, defaults to additive).
- /// Name for the game object (Optional, defaults to "AppliedBrush").
- public GameObject CreateBrush(PrimitiveBrushType brushType, Vector3 localPosition, Vector3 localSize = default(Vector3), Quaternion localRotation = default(Quaternion), Material material = null, CSGMode csgMode = CSGMode.Add, string brushName = null)
- {
- GameObject brushObject;
- if(!string.IsNullOrEmpty(brushName))
- {
- brushObject = new GameObject(brushName);
- }
- else
- {
- brushObject = new GameObject("AppliedBrush");
- }
-
- brushObject.transform.parent = this.transform;
- brushObject.transform.localPosition = localPosition;
- if(localRotation != default(Quaternion))
- {
- brushObject.transform.localRotation = localRotation;
- }
- PrimitiveBrush primitiveBrush = brushObject.AddComponent();
- primitiveBrush.BrushType = brushType;
- primitiveBrush.Mode = csgMode;
- primitiveBrush.ResetPolygons();
-
- if(localSize != default(Vector3)
- && localSize != new Vector3(2,2,2))
- {
- BrushUtility.Resize(primitiveBrush, localSize);
- }
+ public bool HasBrushBeenBuilt(Brush candidateBrush)
+ {
+ return builtBrushes.Contains(candidateBrush);
+ }
+
+ ///