- Home /
Question by
LokiFirebringer · Dec 11, 2011 at 01:41 AM ·
javascripterroreditor
Problems with creating custom EditorGUI for script
Okay, so I follow the instructions in the section [Extending the Editor][1] for creating a custom Inspector GUI for my script, but I cannot get my GUI to do anything. It shows up, but then nothing works. I'm placing it in the right place and everything!
Here's my code:
@CustomEditor (DayAndNight)
class DayAndNightEditor extends Editor {
function OnInspectorGUI () {
target.dayLength = EditorGUILayout.IntSlider("Day Length (In Minutes)",1,1,1440);
if (GUI.changed)
EditorUtility.SetDirty (target);
}
}
What exactly am I doing wrong? [1]: http://unity3d.com/support/documentation/Components/gui-ExtendingEditor.html
Comment