public override void OnInspectorGUI()
    {
        MapPreview mapPreview = (MapPreview)target;

        // Auto update on change
        if (DrawDefaultInspector())
        {
            if (mapPreview.autoUpdate)
            {
                mapPreview.DrawMapInEditor();
            }
        }

        if (mapPreview)
        {
            if (mapPreview.drawMode == DrawMode.FalloffMap || mapPreview.drawMode == DrawMode.NoiseMap)
            {
                mapPreview.ShowTexturePreview();
            }

            if (mapPreview.drawMode == DrawMode.Mesh)
            {
                mapPreview.ShowMeshPreview();
            }
        }

        if (GUILayout.Button("Generate"))
        {
            mapPreview.DrawMapInEditor();
        }
    }
        public override void OnInspectorGUI()
        {
            MapPreview mapGen = (MapPreview)target;

            if (GUILayout.Button("Generate"))
            {
                mapGen.DrawMapInEditor();
            }
            else if (DrawDefaultInspector())
            {
                mapGen.DrawMapInEditor();
            }
        }
    public override void OnInspectorGUI()
    {
        MapPreview mapGenerator = (MapPreview)target;

        if (DrawDefaultInspector() && mapGenerator.AutoUpdate)
        {
            mapGenerator.DrawMapInEditor();
        }

        if (GUILayout.Button("Generate"))
        {
            mapGenerator.DrawMapInEditor();
        }
    }
Ejemplo n.º 4
0
    public override void OnInspectorGUI()
    {
        MapPreview mapPreview = (MapPreview)target;

        if (DrawDefaultInspector())
        {
            if (mapPreview.autoUpdate)
            {
                mapPreview.DrawMapInEditor();
            }
        }

        if (UnityEngine.GUILayout.Button("Generate"))
        {
            mapPreview.DrawMapInEditor();
        }
    }
Ejemplo n.º 5
0
    public override void OnInspectorGUI()
    {
        //base.OnInspectorGUI();
        MapPreview map = (MapPreview)target;

        if (DrawDefaultInspector())
        {
            if (map.autoUpdate == true)
            {
                map.DrawMapInEditor();
            }
        }

        if (CustomEditorGUI.Buttons.AddButton("Generate Map"))
        {
            map.DrawMapInEditor();
        }
    }
Ejemplo n.º 6
0
    public override void OnInspectorGUI()
    {
        MapPreview mapPreview = (MapPreview)target;

        if (DrawDefaultInspector())
        {
            if (mapPreview.autoUpdate)
            {
                mapPreview.DrawMapInEditor();
            }
        }

        if (GUILayout.Button("Generate"))
        {
            mapPreview.DrawMapInEditor();
        }

        if (GUILayout.Button("Destroy Objects"))
        {
            //mapPreview.DestroyObjects ();
        }
    }
    /// <summary>
    /// Adds the button to the inspector GUI.
    /// </summary>
    public override void OnInspectorGUI()
    {
        // the object being inspected
        MapPreview mapPreview = (MapPreview)target;

        // draws the built in inspector
        if (DrawDefaultInspector())
        {
            // checks if the scene is supposed to auto update when values are changed
            if (mapPreview.autoUpdate)
            {
                // redraws the map
                mapPreview.DrawMapInEditor();
            }
        }

        // checks if the generate button was pressed
        if (GUILayout.Button("Generate"))
        {
            // redraws the map
            mapPreview.DrawMapInEditor();
        }
    }