x


texture2d field in a custom editor window

I made a custom window for the editor, but I can't figure out how to create a window where a texture can be plugged in.

more ▼

asked Jun 03 '11 at 02:47 PM

Johan 4 gravatar image

Johan 4
412 81 84 97

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

3 answers: sort voted first

Figured it out, needed to change object type from object to texture2d

more ▼

answered Jun 09 '11 at 11:00 AM

Johan 4 gravatar image

Johan 4
412 81 84 97

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

answered Jun 03 '11 at 02:57 PM

Tom 17 gravatar image

Tom 17
269 5 7 15

Is this what the editor gui uses? It doesn't seem so.

Jun 03 '11 at 03:24 PM Johan 4
(comments are locked)
10|3000 characters needed characters left

heres how I got it to work (C #)

Texture2D backgroundImage;

OnGUI(){ backgroundImage = (Texture2D) EditorGUILayout.ObjectField("Image", backgroundImage, typeof (Texture2D), false); }

more ▼

answered Oct 04 '11 at 01:19 AM

nibbler gravatar image

nibbler
1

(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:

x1665
x353
x200

asked: Jun 03 '11 at 02:47 PM

Seen: 2506 times

Last Updated: Oct 04 '11 at 01:19 AM