SHARE
TWEET

Untitled

a guest Jul 17th, 2017 45 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. using UnityEngine;
  2. using UnityEditor;
  3.  
  4. [CustomEditor(typeof(CityGenerator))]
  5. public class CityEditor : Editor
  6. {
  7.     public override void OnInspectorGUI()
  8.     {
  9.         DrawDefaultInspector();
  10.        
  11.         if (GUILayout.Button("generate"))
  12.         {
  13.             CityGenerator c = FindObjectOfType<CityGenerator>();
  14.             if(c)
  15.             {
  16.                 c.Generate(CityGenerator.cities.metropolis, CityGenerator.water.rivers);
  17.             }
  18.         }
  19.     }
  20. }
RAW Paste Data
Top