Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
* Fixed a compiler error and a warning introduced in a beta of Unity …
…5.5. This has been tested on Unity 5.5b8, if you experience any issues with shortcut keys on an earlier 5.5 beta this is due to a compiler bug and you'll need to update to a newer 5.5 beta.

* Updated Readme file to include some more details
  • Loading branch information
Barnaby MacBook committed Oct 23, 2016
1 parent ec373c0 commit 3177210
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 2 deletions.
19 changes: 18 additions & 1 deletion README.md
@@ -1,2 +1,19 @@
# SabreCSG
Level design tools for Unity

SabreCSG is a set of level design tools for building complex levels quickly inside Unity. Using Constructive Solid Geometry techniques SabreCSG allows you to add and subtract brushes to create great levels without needing to understand 3D art packages.

SabreCSG was originally sold on the [Unity Asset Store](https://www.assetstore.unity3d.com/en/#!/content/47418), but as of 14th October 2016 has been [open sourced](http://sabrecsg.com/2016/10/14/sabrecsg-released-as-open-source/) under the MIT License (see LICENSE for details). It is now maintained on this [Github repository](https://github.com/sabresaurus/SabreCSG).

Core Features:

- Boolean CSG algorithm supporting partial rebuilding
- Draw tools to rapidly create levels by drawing brushes directly
- Resize tools allow you to resize spaces intuitively
- Vertex tools to refine and add precision details
- Change materials or edit UVs with surface tools built for level design
- Clip planes allow you to bevel brushes or even split them in two
- Export built geometry to .OBJ for use in external 3D tools
- Vertex Colors - Apply vertex colors per face which are baked into the built meshes
- Experimental Code API - Experimental support for procedurally generating levels through code

Documentation and videos on how to use SabreCSG are available at the [SabreCSG Learn website](http://sabrecsg.com/learn/)
6 changes: 6 additions & 0 deletions Scripts/Brushes/PrimitiveBrush.cs 100644 → 100755
Expand Up @@ -143,7 +143,13 @@ void Start()
}

#if UNITY_EDITOR
#if UNITY_5_5_OR_NEWER
// Unity 5.5 introduces a second possible selection highlight state, so the hiding API has changed
UnityEditor.EditorUtility.SetSelectedRenderState(GetComponent<Renderer>(), UnityEditor.EditorSelectedRenderState.Hidden);
#else
// Pre Unity 5.5 the only selection highlight was a wireframe
UnityEditor.EditorUtility.SetSelectedWireframeHidden(GetComponent<Renderer>(), true);
#endif
#endif

objectVersionUnserialized = objectVersionSerialized;
Expand Down
13 changes: 12 additions & 1 deletion Scripts/Tools/SurfaceEditor.cs 100644 → 100755
Expand Up @@ -1153,7 +1153,18 @@ void DrawMaterialBox()
// Ignore normal maps
string assetPath = AssetDatabase.GetAssetPath(newTexture);
TextureImporter importer = TextureImporter.GetAtPath(assetPath) as TextureImporter;
if(!importer.normalmap)

#if UNITY_5_5_OR_NEWER
// Unity 5.5 refactored the TextureImporter, requiring slightly different logic
TextureImporterSettings importerSettings = new TextureImporterSettings();
importer.ReadTextureSettings(importerSettings);
bool isNormalMap = importerSettings.textureType == TextureImporterType.NormalMap;
#else
// Pre Unity 5.5 way of checking if a texture is a normal map
bool isNormalMap = importer.normalmap;
#endif

if(!isNormalMap)
{
secondaryTexture = newTexture;
break;
Expand Down

0 comments on commit 3177210

Please sign in to comment.