public override void OnInspectorGUI() { serializedObject.Update(); EditorGUILayout.IntSlider(meshQuality, 0, 99, new GUIContent("Mesh Quality")); EditorGUILayout.Slider(roadWidth, 1.0f, 100.0f, new GUIContent("Base Road Width")); bool bLast = m_target.closed; bool bClosed = EditorGUILayout.Toggle("Closed", bLast); if (bLast != bClosed) { m_target.Close(bClosed); } EditorGUILayout.PropertyField(defaultMaterial); if (GUILayout.Button("Build Mesh")) { RoadMeshBuilder.BuildMeshForRoad(m_target); } EditorUtility.SetDirty(m_target); serializedObject.ApplyModifiedProperties(); }
private void _UpdateMesh() { if (m_target.last && m_target.last.mesh != null) { RoadMeshBuilder.BuildMeshForPath(m_target.last); RoadMeshBuilder.BuildMeshForPath(m_target.last.lastPath); } if (m_target.next && m_target.next.mesh != null) { RoadMeshBuilder.BuildMeshForPath(m_target.next); RoadMeshBuilder.BuildMeshForPath(m_target.next.nextPath); } }