42 lines
800 B
C#
42 lines
800 B
C#
using System;
|
|
using Assets;
|
|
using Assets.Scripts;
|
|
using UnityEditor;
|
|
using UnityEngine;
|
|
using Random = UnityEngine.Random;
|
|
|
|
namespace Assets.Editor
|
|
{
|
|
[CustomEditor(typeof(CityGenerator))]
|
|
public class CityGeneratorUI : UnityEditor.Editor
|
|
{
|
|
|
|
|
|
public override void OnInspectorGUI()
|
|
{
|
|
CityGenerator generator = (CityGenerator)target;
|
|
|
|
DrawDefaultInspector();
|
|
|
|
if (GUILayout.Button("Reset"))
|
|
{
|
|
generator.Reset();
|
|
}
|
|
|
|
if (GUILayout.Button("Generate"))
|
|
{
|
|
generator.Reset();
|
|
generator.Generate();
|
|
}
|
|
|
|
if (GUILayout.Button("New City"))
|
|
{
|
|
generator.NewCity();
|
|
}
|
|
|
|
|
|
}
|
|
}
|
|
}
|
|
|