More than one drag able window

I have two drag able windows but only one will show can you only have one?

Do the GUI.Windows both have different ID’s?

Karl

var windowRecta : Rect = Rect (20, 150, 320, 250);
function OnGUI () {
windowRecta = GUI.Window (0, windowRecta, DoMyWindowa, "Armies");

}
function DoMyWindowa (windowID : int) {



GUI.DragWindow ();
}
var windowRect : Rect = Rect (20, 150, 320, 250);
function OnGUI () {
windowRect = GUI.Window (0, windowRect, DoMyWindow, "Chat");
}
function DoMyWindow(windowID : int) {



GUI.DragWindow ();
}

Both your windows have the ID 0, they need to have unique ID’s.

Try

var windowRecta : Rect = Rect (20, 150, 320, 250);

function OnGUI () {

windowRecta = GUI.Window ( "Armies".GetHashCode() , windowRecta, DoMyWindowa, "Armies");

}

function DoMyWindowa (windowID : int) {

 

 

 

GUI.DragWindow ();

}

and

var windowRect : Rect = Rect (20, 150, 320, 250);

function OnGUI () {

windowRect = GUI.Window ("Chat".GetHashCode(), windowRect, DoMyWindow, "Chat");

}

function DoMyWindow(windowID : int) {

 

 

 

GUI.DragWindow ();

}