public override void OnInspectorGUI()
    {
        CityGenerator cityGenerator = (CityGenerator)target;

        if (DrawDefaultInspector())
        {
            if (cityGenerator.autoUpdate)
            {
                cityGenerator.DeleteCity();
                cityGenerator.LoadBuildingsWithRectanglePlots();
            }
        }

        if (GUILayout.Button("Generate"))
        {
            cityGenerator.DeleteCity();
            cityGenerator.LoadBuildingsWithRectanglePlots();
        }

        if (GUILayout.Button("Update Height"))
        {
            cityGenerator.UpdateHeight();
        }
    }
示例#2
0
    public override void OnInspectorGUI()
    {
        DrawDefaultInspector();


        CityGenerator myScript = (CityGenerator)target;


        GUILayout.Label("City Funcionality", EditorStyles.boldLabel);
        if (GUILayout.Button("Generate City"))
        {
            myScript.DeleteCity();
            myScript.GenerateCity(myScript.perlinNoise);
        }

        if (GUILayout.Button("Delete City"))
        {
            myScript.DeleteCity();
        }

        GUILayout.Label("Enviroment Options", EditorStyles.boldLabel);
        if (GUILayout.Button("Set Day Time"))
        {
            myScript.SetDayTime();
        }

        if (GUILayout.Button("Set Noon Time"))
        {
            myScript.SetNoonTime();
        }

        if (GUILayout.Button("Set Night Time"))
        {
            myScript.SetNightTime();
        }
    }