x


EditorGUI.ObjectField placed right below EditorGUI.Foldout?

so i have a set of foldouts and i want to get the position in the inspector of one of the fold outs so i can place my object field accordingly is there a way of getting the position in the inspector of the foldout?

Here is my current code( i was experimenting with tower1DropDown.position.width, but it isn't working):

humanDropDown = EditorGUILayout.Foldout(humanDropDown,"Humans");
    if(humanDropDown){
       EditorGUI.indentLevel = 1;
       hTowers = EditorGUILayout.Foldout(hTowers,"Towers");
       if(hTowers){
         EditorGUI.indentLevel = 2;
         tower1DropDown = EditorGUILayout.Foldout(tower1DropDown,"Tower 1");
         if(tower1DropDown){
          target.tower1CostH = EditorGUILayout.IntField("Tower 1 Cost: ",target.tower1CostH);
          target.tower1GhostH = EditorGUI.ObjectField(Rect(tower1DropDown.position.width,0,150,60),target.tower1GhostH,GameObject);

         }
more ▼

asked Feb 05 '12 at 09:17 PM

IMTRIGGERHAPPY9 gravatar image

IMTRIGGERHAPPY9
132 29 43 44

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

1 answer: sort voted first
more ▼

answered Feb 06 '12 at 01:15 PM

Aeless gravatar image

Aeless
91 3

(comments are locked)
10|3000 characters needed characters left
Your answer
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:

x3688
x69
x29
x6

asked: Feb 05 '12 at 09:17 PM

Seen: 652 times

Last Updated: Feb 06 '12 at 01:15 PM