Skip to content
This repository has been archived by the owner on Jun 26, 2021. It is now read-only.

Commit

Permalink
Version 1.9_FH
Browse files Browse the repository at this point in the history
- Added/Updated some regions
- Removed an empty function
- Minor Layout changes
- Bumped to next Version number
  • Loading branch information
FritzsHero committed Jul 10, 2019
1 parent 1c87f50 commit 5f95f62
Show file tree
Hide file tree
Showing 9 changed files with 104 additions and 59 deletions.
15 changes: 12 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,16 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).


## [Version: 1.9_FH] - 2019.xx.xx
## [Version: 2.0_FH] - 2019.xx.xx
### Improvements
-


## [Version: 1.9_FH] - 2019.04.22
### Improvements
- Improved the Help Window with new Layout and Links
- Redone #if UNITY_EDITOR in Scripts
- Removed an empty function

### Changed
- Changed links, which redirected to Github, with the Github Wiki Link of the Master. Closed embeddedt/RoadArchitect/issues/6
Expand All @@ -20,9 +27,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Added missing private attribute on some Vars and Functions
- Added "Imports" Regions in the Scripts for better overview
- Added a "Report a Bug" MenuItem, which links to https://github.com/embeddedt/RoadArchitect/issues
- Added/Updated some regions

### Fixed
-

## [Version: 1.8_FH] - 2019.02.10
### Improvements
Expand All @@ -39,17 +45,20 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Fixed
- Fixed embeddedt/RoadArchitect/issues/4


## [Version: 1.7.5a_FH] - 2019.01.31
### Changed
- Changed most Layouts of the Scripts
- Changed some Vars in Scripts to better reflect their purpose


## [Version 1.7] - 2018.07.16
### Changed
- Adds support for Unity 2018.x
- Updates to unit tests
- No further Informations given at this point


## [Version 1.6] - 2017.02.28
### Changed
- Initial Release
Expand Down
38 changes: 20 additions & 18 deletions Editor/GSDSplineNEditor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public class GSDSplineNEditor : Editor
private float HorizRoadMax = 0;


#region Button icons:
#region "Button icons"
private Texture btnDeleteText = null;
private Texture btnCopyText = null;
private Texture btnSaveText = null;
Expand Down Expand Up @@ -396,7 +396,7 @@ public override void OnInspectorGUI()

Line();

#region Online Manual on Top of SplineN Scripts
#region "Online Manual on Top of SplineN Scripts"
EditorGUILayout.BeginHorizontal();
EditorGUILayout.LabelField(tNode.EditorDisplayString, EditorStyles.boldLabel);

Expand All @@ -419,7 +419,7 @@ public override void OnInspectorGUI()
#endregion


#region Option: Manual road cut:
#region "Option: Manual road cut"
if (tNode.idOnSpline > 0 && tNode.idOnSpline < (tNode.GSDSpline.GetNodeCount() - 1) && !tNode.bIsIntersection && !tNode.bSpecialEndNode)
{ // && !cNode.bIsBridge_PreNode && !cNode.bIsBridge_PostNode){
if (tNode.GSDSpline.tRoad.opt_bDynamicCuts)
Expand Down Expand Up @@ -1025,7 +1025,7 @@ public void DoSplineObjects()
EditorGUILayout.EndVertical();


#region Vertical offset:
#region "Vertical offset"
EditorGUILayout.LabelField("Vertical options:");
EditorGUILayout.BeginVertical("box");
EditorGUILayout.BeginHorizontal();
Expand All @@ -1038,9 +1038,11 @@ public void DoSplineObjects()
#endregion


#region Vertical curve:
#region "Vertical curve"
if (SMM.VerticalCurve == null || SMM.VerticalCurve.keys.Length < 2)
{ EnforceCurve(ref SMM.VerticalCurve); }
{
EnforceCurve(ref SMM.VerticalCurve);
}
EditorGUILayout.BeginHorizontal();
SMM.EM.VerticalCurve = EditorGUILayout.CurveField("Curve: ", SMM.VerticalCurve);
if (GUILayout.Button(btnDefaultText, GSDImageButton, GUILayout.Width(16f)))
Expand All @@ -1052,7 +1054,7 @@ public void DoSplineObjects()
EditorGUILayout.EndVertical();


#region Horizontal offsets:
#region "Horizontal offsets"
SMM.EM.HorizontalSep = SMM.HorizontalSep;
EditorGUILayout.LabelField("Horizontal offset options:");
EditorGUILayout.BeginVertical("box");
Expand Down Expand Up @@ -1495,7 +1497,7 @@ public void DoEdgeObjects()
}


#region Material override:
#region "Material override"
EOM.EM.bMaterialOverride = EditorGUILayout.Toggle("Material override: ", EOM.bMaterialOverride);
if (!EOM.bMaterialOverride)
{
Expand Down Expand Up @@ -1582,7 +1584,7 @@ public void DoEdgeObjects()
#endregion


#region Combine Mesh / MeshCollider
#region "Combine Mesh / MeshCollider"
if (EOM.bSingle)
{
EOM.EM.bCombineMesh = false;
Expand All @@ -1599,7 +1601,7 @@ public void DoEdgeObjects()
#endregion


#region SingleObject
#region "SingleObject"
EOM.EM.bSingle = EditorGUILayout.Toggle("Single object only: ", EOM.bSingle);
if (EOM.EM.bSingle != EOM.bSingle)
{
Expand Down Expand Up @@ -1641,7 +1643,7 @@ public void DoEdgeObjects()
}


#region Match Road
#region "Match Road"
EOM.EM.bStartMatchRoadDefinition = EditorGUILayout.Toggle("Match road definition: ", EOM.bStartMatchRoadDefinition);
if (EOM.bStartMatchRoadDefinition)
{
Expand All @@ -1666,7 +1668,7 @@ public void DoEdgeObjects()
}


#region Start param
#region "Start param"
EditorGUILayout.BeginHorizontal();
EOM.EM.StartTime = EditorGUILayout.Slider("Start param: ", EOM.StartTime, tNode.MinSplination, EOM.EndTime); // EndTime = 1f??

Expand All @@ -1684,7 +1686,7 @@ public void DoEdgeObjects()
#endregion


#region End param
#region "End param"
EditorGUILayout.BeginHorizontal();
EOM.EM.EndTime = EditorGUILayout.Slider("End param: ", EOM.EndTime, EOM.StartTime, tNode.MaxSplination);
//Mathf.Clamp(EditorGUILayout.Slider( "End param: ", EOM.EndTime, 0f/*EOM.StartTime*/, 1f/*tNode.MaxSplination*/ ), 0f, 1f);
Expand Down Expand Up @@ -1717,7 +1719,7 @@ public void DoEdgeObjects()
EditorGUILayout.EndVertical();


#region Vertical offset:
#region "Vertical offset"
EditorGUILayout.LabelField("Vertical options:");
EditorGUILayout.BeginVertical("box");

Expand All @@ -1744,7 +1746,7 @@ public void DoEdgeObjects()
#endregion


#region Horizontal offsets:
#region "Horizontal offsets"
EditorGUILayout.LabelField("Horizontal offset options:");
EditorGUILayout.BeginVertical("box");
tHorizMatching = HorizMatchingDefaultsEnum.None;
Expand Down Expand Up @@ -1817,7 +1819,7 @@ public void DoEdgeObjects()
#endregion


#region Rotation/scale options
#region "Rotation/scale options"
EditorGUILayout.LabelField("Rotation/scale options:");
EditorGUILayout.BeginVertical("box");
if (EOM.HorizontalSep < 0f)
Expand Down Expand Up @@ -2464,7 +2466,7 @@ private bool VectorDiff(Vector3 tVect1, Vector3 tVect2)
}


#region Triggers Interesctions; Connections; Update
#region "Triggers Interesctions; Connections; Update"
private void TriggerRoadConnection(GSDSplineN tNode1, GSDSplineN tNode2)
{
tNode.GSDSpline.ActivateEndNodeConnection(tNode1, tNode2);
Expand All @@ -2490,7 +2492,7 @@ private void TriggerRoadUpdate()
#endregion


#region Optimizable // LineGUILayout
#region "Optimizable // LineGUILayout"
private void Line()
{
GUILayout.Space(4f);
Expand Down
7 changes: 0 additions & 7 deletions GSDOffRoadObject.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,4 @@ public class GSDOffRoadObject : MonoBehaviour
{
public static readonly Color Color_NodeOffRoadColor = new Color(1f, 0f, 0.5f, 0.75f);
public static readonly Color Color_NodeOffRoadSelectedColor = new Color(1f, 0f, 0.8f, 1f);


// Update is called once per frame
private void Update()
{

}
}
75 changes: 57 additions & 18 deletions GSDRoad.cs
Original file line number Diff line number Diff line change
Expand Up @@ -512,7 +512,9 @@ public void UpdateRoad(RoadUpdateTypeEnum tUpdateType = RoadUpdateTypeEnum.Full)


if (bProfiling)
{ UnityEngine.Profiling.Profiler.BeginSample("UpdateRoadPrelim"); }
{
UnityEngine.Profiling.Profiler.BeginSample("UpdateRoadPrelim");
}
opt_RoadDefinition = Mathf.Clamp(opt_RoadDefinition, 1f, 50f);
opt_LaneWidth = Mathf.Clamp(opt_LaneWidth, 0.2f, 500f);
EditorConstructionStartTime = Time.realtimeSinceStartup;
Expand All @@ -530,7 +532,9 @@ public void UpdateRoad(RoadUpdateTypeEnum tUpdateType = RoadUpdateTypeEnum.Full)

bProfiling = true;
if (GSDRS.opt_bMultithreading)
{ bProfiling = false; }
{
bProfiling = false;
}

//Set all terrains to height 0:
GSD.Roads.GSDTerraforming.CheckAllTerrainsHeight0();
Expand All @@ -540,11 +544,20 @@ public void UpdateRoad(RoadUpdateTypeEnum tUpdateType = RoadUpdateTypeEnum.Full)
if (Editor_bIsConstructing)
{
if (TerrainCalcsJob != null)
{ TerrainCalcsJob.Abort(); TerrainCalcsJob = null; }
{
TerrainCalcsJob.Abort();
TerrainCalcsJob = null;
}
if (RoadCalcsJob1 != null)
{ RoadCalcsJob1.Abort(); RoadCalcsJob1 = null; }
{
RoadCalcsJob1.Abort();
RoadCalcsJob1 = null;
}
if (RoadCalcsJob2 != null)
{ RoadCalcsJob2.Abort(); RoadCalcsJob2 = null; }
{
RoadCalcsJob2.Abort();
RoadCalcsJob2 = null;
}
Editor_bIsConstructing = false;
}

Expand Down Expand Up @@ -673,29 +686,53 @@ public void UpdateRoad(RoadUpdateTypeEnum tUpdateType = RoadUpdateTypeEnum.Full)
{
//Delete old objs and return:
if (MainMeshes != null)
{ Object.DestroyImmediate(MainMeshes); }
{
Object.DestroyImmediate(MainMeshes);
}
if (MeshRoad != null)
{ Object.DestroyImmediate(MeshRoad); }
{
Object.DestroyImmediate(MeshRoad);
}
if (MeshShoR != null)
{ Object.DestroyImmediate(MeshShoR); }
{
Object.DestroyImmediate(MeshShoR);
}
if (MeshShoL != null)
{ Object.DestroyImmediate(MeshShoL); }
{
Object.DestroyImmediate(MeshShoL);
}
if (MeshiLanes != null)
{ Object.DestroyImmediate(MeshiLanes); }
{
Object.DestroyImmediate(MeshiLanes);
}
if (MeshiLanes0 != null)
{ Object.DestroyImmediate(MeshiLanes0); }
{
Object.DestroyImmediate(MeshiLanes0);
}
if (MeshiLanes1 != null)
{ Object.DestroyImmediate(MeshiLanes1); }
{
Object.DestroyImmediate(MeshiLanes1);
}
if (MeshiLanes2 != null)
{ Object.DestroyImmediate(MeshiLanes2); }
{
Object.DestroyImmediate(MeshiLanes2);
}
if (MeshiLanes3 != null)
{ Object.DestroyImmediate(MeshiLanes3); }
{
Object.DestroyImmediate(MeshiLanes3);
}
if (MeshiMainPlates != null)
{ Object.DestroyImmediate(MeshiMainPlates); }
{
Object.DestroyImmediate(MeshiMainPlates);
}
if (MeshiMarkerPlates != null)
{ Object.DestroyImmediate(MeshiMarkerPlates); }
{
Object.DestroyImmediate(MeshiMarkerPlates);
}
if (bProfiling)
{ UnityEngine.Profiling.Profiler.EndSample(); }
{
UnityEngine.Profiling.Profiler.EndSample();
}
return;
}

Expand Down Expand Up @@ -740,7 +777,9 @@ public void UpdateRoad(RoadUpdateTypeEnum tUpdateType = RoadUpdateTypeEnum.Full)
tTerrain = null;

if (bProfiling)
{ UnityEngine.Profiling.Profiler.EndSample(); }
{
UnityEngine.Profiling.Profiler.EndSample();
}

if (GSDRS.opt_bMultithreading)
{
Expand Down
2 changes: 2 additions & 0 deletions GSDRoadConnector.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ public class GSDRoadConnector : MonoBehaviour


#if UNITY_EDITOR
#region "Gizmos"
private void OnDrawGizmos()
{
Gizmos.color = GSDOffRoadObject.Color_NodeOffRoadColor;
Expand All @@ -29,6 +30,7 @@ private void OnDrawGizmosSelected()
Gizmos.color = GSDOffRoadObject.Color_NodeOffRoadSelectedColor;
Gizmos.DrawCube(transform.position + new Vector3(0f, 6.25f, 0f), new Vector3(3.5f, 12.5f, 3.5f));
}
#endregion


public void ConnectToNode(GSDSplineN node)
Expand Down
4 changes: 2 additions & 2 deletions GSDRoadEdgeObjects.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public class EdgeObjectMaker
public bool bIsBridge = false;


#region Horizontal offsets:
#region "Horizontal offsets"
public float HorizontalSep = 5f;
public AnimationCurve HorizontalCurve;
public float HorizCurve_tempchecker1 = 0f;
Expand All @@ -60,7 +60,7 @@ public class EdgeObjectMaker
#endregion


#region Vertical offsets:
#region "Vertical offsets"
public float VerticalRaise = 0f;
public AnimationCurve VerticalCurve;
public float VerticalCurve_tempchecker1 = 0f;
Expand Down
Loading

0 comments on commit 5f95f62

Please sign in to comment.