Beispiel #1
0
    private void EstadoServidorEsperandoEmpezar()
    {
        //elegir número de cartas y palos
        GUILayout.BeginArea(espacioElegirPalosCartas);

        GUILayout.BeginVertical();
        GUILayout.Label("Número de palos: " + palosSeleccionados);
        PonerPalos(GUILayout.HorizontalSlider(palosSeleccionados, 1, 4));
        GUILayout.Label("Número de cartas por palo: " + cartasPorPaloSeleccionada);
        PonerCartasPorPalo(GUILayout.HorizontalSlider(cartasPorPaloSeleccionada, 1, maxCartasPorPalo));
        GUILayout.EndVertical();

        GUILayout.EndArea();


        //selección tipo baraja
        GUILayout.BeginArea(espacioCartas);
        GUILayout.BeginHorizontal();
        GUI.skin.button.normal.background = null;

        //opciones.nReversoCartas = GUILayout.SelectionGrid(opciones.nReversoCartas, opciones.listaReversoCartas,
        //opciones.listaReversoCartas.Length, GUILayout.MaxWidth(Screen.width * 9/10),GUILayout.MaxHeight(Screen.height * 2/5));

        //GUI.skin.button.normal.background = opciones.estiloBotones;
        indiceBaraja = GUILayout.SelectionGrid(indiceBaraja, listaBarajas, listaBarajas.Length,
                                               GUILayout.MaxWidth(Screen.width * 9 / 10), GUILayout.MaxHeight(Screen.height * 2 / 5));
        creaCartas.tipoBaraja = barajas[indiceBaraja];

        //si es la baraja española hay 12 cartas max por palo, sino, son 13
        if (indiceBaraja == 0)
        {
            maxCartasPorPalo = 12;
            if (cartasPorPaloSeleccionada == 13)
            {
                cartasPorPaloSeleccionada = 12;
            }
        }
        else
        {
            maxCartasPorPalo = 13;
        }

        GUILayout.EndHorizontal();
        GUILayout.EndArea();
        GUI.skin.button.normal.background = opciones.estiloBotones;

        //boton empezar partida
        GUILayout.BeginArea(espacioFinal);
        GUI.skin.button = estiloGUIBotones;
        if (CrearBoton("Empezar partida"))
        {
            GameObject.FindGameObjectWithTag("CreaCartas").GetComponent <CreaCartas>().CrearCartas();
            GameObject.FindGameObjectWithTag("Apilacartas").GetComponent <ApilaCartas>().Apilar();
            estado = Estado.Jugando;
            var eventoEmpezar = GuiIngameEvent.Create();
            eventoEmpezar.JuegoEmpezado = true;
            eventoEmpezar.Send();
        }
        GUILayout.EndArea();
    }
Beispiel #2
0
 public override void OnEvent(GuiIngameEvent evnt)
 {
     Debug.Log("Evento guiIngame con estado " + evnt.JuegoEmpezado);
     if (evnt.JuegoEmpezado)
     {
         estado = Estado.Jugando;
     }
 }