Skip to content

Commit 764f866

Browse files
committed
Namespace
1 parent 1484bbd commit 764f866

28 files changed

+1794
-1720
lines changed

Editor/WorldMapGeneratorEditor.cs

Lines changed: 20 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,28 @@
11
using UnityEditor;
22
using UnityEngine;
33

4-
[CustomEditor(typeof(WorldMapGenerator),true)]
5-
public class WorldMapGeneratorEditor : Editor
4+
namespace Gameframe.WorldMapGen
65
{
7-
8-
private bool autoUpdate = false;
9-
10-
public override void OnInspectorGUI()
6+
[CustomEditor(typeof(WorldMapGenerator), true)]
7+
public class WorldMapGeneratorEditor : Editor
118
{
12-
EditorGUI.BeginChangeCheck();
13-
base.OnInspectorGUI();
14-
if (EditorGUI.EndChangeCheck() && autoUpdate )
15-
{
16-
((WorldMapGenerator)target).GenerateMap();
17-
}
18-
19-
autoUpdate = EditorGUILayout.Toggle("Auto Update", autoUpdate);
20-
21-
if (GUILayout.Button("Generate"))
9+
private bool autoUpdate = false;
10+
11+
public override void OnInspectorGUI()
2212
{
23-
((WorldMapGenerator)target).GenerateMap();
13+
EditorGUI.BeginChangeCheck();
14+
base.OnInspectorGUI();
15+
if (EditorGUI.EndChangeCheck() && autoUpdate)
16+
{
17+
((WorldMapGenerator) target).GenerateMap();
18+
}
19+
20+
autoUpdate = EditorGUILayout.Toggle("Auto Update", autoUpdate);
21+
22+
if (GUILayout.Button("Generate"))
23+
{
24+
((WorldMapGenerator) target).GenerateMap();
25+
}
2426
}
2527
}
26-
}
28+
}

0 commit comments

Comments
 (0)