Skip to content
Snippets Groups Projects
Commit f60eb3b8 authored by Kent Holt's avatar Kent Holt
Browse files

Finished set up of CityGenWindow class + did some testing with UI + started on...

Finished set up of CityGenWindow class + did some testing with UI + started on generalizing the City Selection Menu
parent 3022fc57
No related branches found
No related tags found
No related merge requests found
using System.Collections; using UnityEngine;
using System.Collections.Generic; using UnityEditor;
using UnityEngine;
public class CityGenWindow : MonoBehaviour { public class CityGenWindow : EditorWindow
{
string saveFolder = Application.persistentDataPath + "/CityData";
bool citySelectionMenuEnabled = true;
Vector2 citySelectionMenuScrollPosition;
// Use this for initialization public void OnGUI()
void Start () { {
MakeCitySelectionMenu();
}
private void MakeCitySelectionMenu()
{
this.citySelectionMenuScrollPosition = GUILayout.BeginScrollView(this.citySelectionMenuScrollPosition, GUILayout.Width(100), GUILayout.Height(100));
for(int i = 0; i < 5; i++)
if (GUILayout.Button("City " + i))
Debug.Log("Clicked on: City " + i);
GUILayout.EndScrollView();
} }
// Update is called once per frame // ######### Container Classes #########
void Update () {
private class CityEntry
{
string cityName;
string filename;
}
// Menu entry
[MenuItem ("Window/City Gen")]
public static void ShowWindow()
{
//Show existing window instance. If one doesn't exist, make one.
EditorWindow.GetWindow<CityGenWindow>("City Gen");
} }
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment