'); -->

# Extending Level Configurator inspector

If you’re a programmer then most probably you want to keep things in one place. Most probably you’re trying to keep all the settings in one place, because the lack of organization in your project can be really painful.

From Mad Level Manager 2.2.7 you’re able to extend the Level Configruation inspector.

Why to extend it in the first place? Let’s say you have things that are closely related to your levels, like level settings kept in a prefab. It can take you a lot of effort to remember where everything is located and even more time to navigate to it. If you’re working with a team, the issue is even more serious.

Level Configuration in Mad Level Manager is a centralized place where you’re changing your level settings, so let’s keep it that way and extend it’s inspector. To do that, simply create a new C# class anywhere in the Editor folder and make it implement IMadLevelConfigurationInspectorAddon interface.

    using UnityEngine;
    using UnityEditor;
    using MadLevelManager;

    public class MyInspector : IMadLevelConfigurationInspectorAddon {
        public int GetOrder() {
            // if you're making more than one inspector addon, then this is the order of drawing
            return 1;
        }

        public void OnInspectorGUI(MadLevelConfiguration.Level level) {
            if (GUILayout.Button("Press me!")) {
                EditorUtility.DisplayDialog("Hello!", "Clicked on level " + level.name, "OK");
            }
        }
    }

Here’s the Level API reference.

Clicking on it of course will result in this pop-up window.

To extend the editor, you can use the same methods as you would do when creating an editor gui.