public override void OnInspectorGUI() { MeshGenerator generator = (MeshGenerator)target; if (generator.baked) { GUILayout.Label("BAKED. DOES NOT UPDATE."); if (GUILayout.Button("Revert Bake")) { generator.Unbake(); EditorUtility.SetDirty(target); } return; } EditorGUI.BeginChangeCheck(); BaseGUI(); ShowInfo(); if (GUILayout.Button("Bake Mesh")) { bakeWindow = EditorWindow.GetWindow <BakeMeshWindow>(); bakeWindow.Init(generator); } if (EditorGUI.EndChangeCheck()) { EditorUtility.SetDirty(target); } }
public override void OnInspectorGUI() { MeshGenerator generator = (MeshGenerator)target; if (generator.baked) { if (SplineEditorGUI.EditorLayoutSelectableButton(new GUIContent("Revert Bake", "Makes the mesh dynamic again and allows editing"), true, true)) { generator.Unbake(); EditorUtility.SetDirty(target); } return; } base.OnInspectorGUI(); }