I have this example code and if I click in “select” the browser opens fine, but the thumbnail doesn’t change at all.
But if I drag the image directly it does.
Any idea what I an doing wrong?
This is the code:
class GUIWindowDemo2 extends EditorWindow {
// The position of the window
var windowRect = Rect (10,10,400,300);
// Scroll position
var scrollPos = Vector2.zero;
var texture;
var texture2;
function OnGUI () {
// Set up a scroll view
scrollPos = GUI.BeginScrollView (
new Rect (0, 0, position.width, position.height),
scrollPos,
new Rect (0, 0, 400, 1000)
);
// Same code as before - make a window. Only now, it’s INSIDE the scrollview
BeginWindows ();
windowRect = GUILayout.Window (1, windowRect, DoWindow, “Hi There”);
EndWindows ();
// Close the scroll view
GUI.EndScrollView ();
}
function DoWindow () {
GUILayout.Button (“Hi”);
//GUI.skin = null;
EditorGUIUtility.LookLikeControls(70, 30);
texture2 = EditorGUILayout.ObjectField(“ne”, texture2, typeof(Texture2D));
texture = EditorGUILayout.ObjectField(“ne”, texture2, typeof(Texture));
GUI.DragWindow ();
}
@MenuItem (“Test/GUIWindow Demo 2”)
static function Init () {
EditorWindow.GetWindow (GUIWindowDemo2);
}
}