I'm doing procedural terrain generation in unity from Sebastian Lague's tutorial, and this code isn't working. How can I fix that?
using System.Collections;
using System.Collections.Generic;
using UnityEditor;
[CustomEditor (typeof(MapGenerator))]
public class MapGeneratorEditor : Editor {
public override void OnInspectorGUI() {
MapGenerator mapGen = (MapGenerator)target;
DrawDefaultInspector ();
if (GUILayout.Button ("Generate")) {
mapGen.GenerateMap ();
}
}
}
CodePudding user response:
You should also include UnityEngine
namespace
using System.Collections;
using System.Collections.Generic;
using UnityEditor;
using UnityEngine;