x


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

more ▼

asked Dec 11, 2011 at 01:41 AM

LokiFirebringer gravatar image

LokiFirebringer
1 6 4 5

(comments are locked)
10|3000 characters needed characters left

0 answers: sort voted first
Be the first one to answer this question
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x9497
x6469
x3757
x2884
x1436

asked: Dec 11, 2011 at 01:41 AM

Seen: 1220 times

Last Updated: Dec 11, 2011 at 01:41 AM