Hi i’m having some trouble while trying to use GUI.Window here’s my code:
void OnGUI()
{
baulRect = GUI.Window(BAUL_WINDOW_ID, baulRect, WindowBaul(BAUL_WINDOW_ID), "Baul");
caracteristicasRect = GUI.Window(CARACT_WINDOW_ID, caracteristicasRect, WindowCaract(CARACT_WINDOW_ID), "Caracteristicas");
}
there’s the OnGUI function, now here are the two functions to draw the window.
private void WindowBaul(int id)
{
GUI.Label(new Rect(screenAncho * .5f, screenAlto * .15f, 100, 20), "Baul:");
}
private void WindowCaract(int id)
{
GUI.Label(new Rect(screenAncho * .76f, screenAlto * .15f, 100, 20), "Nombre:");
GUI.Label(new Rect(screenAncho * .76f, screenAlto * .15f + 22, 100, 20), nombre);//Variable charProperties.Name.Trim()
GUI.Label(new Rect(screenAncho * .76f, screenAlto * .15f + 44, 100, 20), "Velocidad:");
GUI.Box(new Rect(screenAncho * .76f, screenAlto * .15f + 66, velocidad, 20), "");
GUI.Label(new Rect(screenAncho * .76f, screenAlto * .15f + 88, 100, 20), "Fuerza:");
GUI.Box(new Rect(screenAncho * .76f, screenAlto * .15f + 110, fuerza, 20), "");
GUI.Label(new Rect(screenAncho * .76f, screenAlto * .15f + 132, 100, 20), "Turbo:");
GUI.Box(new Rect(screenAncho * .76f, screenAlto * .15f + 154, turbo, 20), "");
}
and here’s the error im getting by now.
error CS1502: The best overloaded method match for `UnityEngine.GUI.Window(int, UnityEngine.Rect, UnityEngine.GUI.WindowFunction, string)’ has some invalid arguments
error CS1503: Argument
#3' cannot convert
void’ expression to type `UnityEngine.GUI.WindowFunction’
error CS1502: The best overloaded method match for `UnityEngine.GUI.Window(int, UnityEngine.Rect, UnityEngine.GUI.WindowFunction, string)’ has some invalid arguments
error CS1503: Argument
#3' cannot convert
void’ expression to type `UnityEngine.GUI.WindowFunction’
Can any body tell me why is this happening? and dont say the obvious, I´ve already tried the documentation and some youtube tutorials, and every one is using the same thing as me!