How to update objects material on Editor

I have a method that changes the color of a level depending on its difficult (hard, easy…). When running (Game view) I see these color changes, but I’d like to see these changes directly on Editor (Scene view) too, when I change the difficult in Inspector panel.

One option is to write a custom inspector and call the code which changes the colour whenever the inspector GUI changed.

http://docs.unity3d.com/Documentation/Components/editor-CustomEditors.html

http://docs.unity3d.com/Documentation/ScriptReference/GUI-changed.html