| 123456789101112131415161718192021222324 |
- using UnityEngine;
- using UnityEditor;
- [CustomEditor(typeof(MapGenerator))]
- public class MapGeneratorEditor : Editor
- {
- public override void OnInspectorGUI()
- {
- MapGenerator mapGen = (MapGenerator)target;
- if (DrawDefaultInspector())
- {
- if (mapGen.autoUpdate)
- {
- mapGen.DrawMapInEditor();
- }
- }
- if (GUILayout.Button("Generate"))
- {
- mapGen.DrawMapInEditor();
- }
- }
- }
|