Hi,
I have two windows, both drags good and when clicked highlights, but only one window buttons work. And the second one is the same size as the first one although i made it a lot bigger
can anyone help?
I tried something with focus, but only first window worked anyway. And theres no sence when you need to click window1 to activate window2.
var Player=false;
var Skills=false;
var windowRectPlayerStats : Rect = Rect (70, 100, 245, 215); // <-- this works
var windowRectPlayerSkills : Rect = Rect (150, 100, 5000, 5000); //<-- this should be big
function Update()
{
if(Input.GetKey(KeyCode.P))
{
if(!Player)
{
Player=true;
}
else
{
Player=false;
}
}
if(Input.GetKey(KeyCode.O))
{
if(!Skills)
{
Skills=true;
}
else
{
Skills=false;
}
}
}
function OnGUI()
{
if(Player)
{
windowRectPlayerStats = GUI.Window (0, windowRectPlayerStats, WindowFunctionPlayer, "Player stats");
}
if(Skills)
{
windowRectPlayerSkills = GUI.Window (1, windowRectPlayerSkills, WindowFunctionSkills, "Skills");
}
}
function WindowFunctionPlayer (windowID : int)
{
GUI.DragWindow (Rect (0,0, 10000, 20));
if (GUI.Button(Rect(10,30,100,30),"Increase number"))
{
number++;
}
GUI.Label (Rect (150, 150, 100, 30), ""+number);
}
function WindowFunctionSkills (windowID : int)
{
var nothing=0;
GUI.DragWindow (Rect (0,0, 10000, 20));
if (GUI.Button(Rect(10,70,100,30), "BIG nothing"))
{
nothing++;
}
GUI.Label (Rect (150, 30, 100, 30), ""+nothing);
}
and also when i click “P” or “O” windows sometimes flashes and switches off. I need to click button few times while window turns on. Same with turning windows off.