Pregunta

Tengo un código como el siguiente:

if( GUI.Button(
  new Rect(Screen.width/4f,50f,Screen.width/2f,Screen.height/9f),"RessetLevel")) {

    showingWinsows = true;
    if(showingWinsows)
    {
      rectWindow = GUI.Window(
        0,
        rectWindow,
        DoMyWindow,
        "Are you sure you want to reset All level ?"
      );
    }    

He insertado el userGuiLayout = false; en mi Awake() función.Pero la ventana todavía no aparece.¿Cómo puedo solucionar esto?

¿Fue útil?

Solución

El problema es que la ventana solo se dibuja cuando se presiona el botón.

Necesitas mover el código que revisa la bandera de la OF (Gui.Button), algo así:

if( GUI.Button(new Rect(Screen.width/4f,50f,Screen.width/2f,Screen.height/9f),"Resset Level"))
{ 
 showingWinsows = true;
}

if(showingWinsows)
{
  rectWindow = GUI.Window(0,rectWindow,DoMyWindow,"Are you sure you want to reset All level ?");
}

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top