示例#1
0
    public override void OnInspectorGUI()
    {
        DrawDefaultInspector();

        polyGrid = (PolyGrid)target;

        tab = GUILayout.Toolbar(tab, typeNames);

        if (polyGrid.NumFaces() == 0)
        {
            if (GUILayout.Button("Create Grid"))
            {
                GridFactory.PopulateSquareGrid(ref polyGrid);
            }
        }

        showGridProperties = EditorGUILayout.Foldout(showGridProperties, "Grid Properties");
        if (showGridProperties)
        {
            ShowGridProps();
        }


        showAdvancedOptions = EditorGUILayout.Foldout(showAdvancedOptions, "Advanced");
        if (showAdvancedOptions)
        {
            ShowAdvancedOptions();
        }
    }
示例#2
0
        void CleanCityGen()
        {
            Debug.Log("PerlinCityGenerator: Cleaning city");
            for (int i = transform.childCount - 1; i >= 0; i--)
            {
                Transform child = transform.GetChild(i);
                DestroyImmediate(child.gameObject);
            }

            if (polyGrid.NumFaces() != 0)
            {
                polyGrid.Clean();
            }
        }