Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System.Collections;
- using System.Collections.Generic;
- using UnityEditor;
- using UnityEngine;
- [CustomEditor(typeof (MapGenerator))]
- public class MapGeneratedEditor : Editor {
- public override void OnInspectorGUI()
- {
- MapGenerator mapGenerator = (MapGenerator)target;
- if (DrawDefaultInspector())
- {
- if(mapGenerator.autoUpdate)
- {
- mapGenerator.GenerateMap();
- }
- }
- if(GUILayout.Button("Generate"))
- {
- mapGenerator.GenerateMap();
- }
- }
- }
Advertisement