Exemplo n.º 1
0
 // Borramos las asignaciones del jugador 2
 public void CancelarJugador2()
 {
     // Pone a 0 todos los valores de las fichas de los jugadores
     FichaSeleccionada.SetCara(0);
     FichaSeleccionada.InicializaFichasJugador2();
     FichaSeleccionada.SetCara(1);
     FichaSeleccionada.InicializaFichasJugador2();
     // Indica como desmarcadas todas las fichas y elementos
     FichaSeleccionada.InicializaFichasSeleccionadas();
     ElementoSeleccionado.SetElementoSeleccionado(0);
 }
Exemplo n.º 2
0
 // Cambiar cara seleccionada
 public void SetCara()
 {
     if (FichaSeleccionada.GetCara() == 0)
     {
         FichaSeleccionada.SetCara(1);
         FichaSeleccionada.InicializaFichasSeleccionadas();
         ElementoSeleccionado.SetElementoSeleccionado(0);
     }
     else
     {
         FichaSeleccionada.SetCara(0);
         FichaSeleccionada.InicializaFichasSeleccionadas();
         ElementoSeleccionado.SetElementoSeleccionado(0);
     }
 }
Exemplo n.º 3
0
    // Al iniciar pone las fichas y banderas con los elementos correspondientes si ya se habían seleccionado
    void Start()
    {
        // Desactivamos el panel de victoria
        IniciaPartida.panelVictoria = GameObject.Find("Fondo");
        IniciaPartida.panelVictoria.SetActive(false);
        IniciaPartida.estaPausado = 0;

        // Desactivamos el panel de Salir
        IniciaPartida.panelSalir = GameObject.Find("FondoSalir");
        IniciaPartida.panelSalir.SetActive(false);

        GameObject bandera = null;

        GameObject[] fichas = null;
        int[,,] datosFichas = new int[2, 9, 2];
        // Añadimos al array todas las fichas y la bandera del jugador 1

        datosFichas = FichaSeleccionada.GetFichasJugadores();
        FichaSeleccionada.SetCara(0);
        ControlTurno.SetTurnoJugador(0);
        fichas = GameObject.FindGameObjectsWithTag("FichasJugador1");
        foreach (GameObject ficha in fichas)
        {
            // recorremos todas las fichas asignando el elemento y añadiendo a las fichas seleccionadas
            if (datosFichas[ControlTurno.GetTurnoJugador(), (ficha.GetComponent <numFichaJugador>().idFicha) - 1, FichaSeleccionada.GetCara()] == 1)
            {
                CambiaObjeto.AsignaFuegoBlanco(ficha);
            }

            if (datosFichas[ControlTurno.GetTurnoJugador(), (ficha.GetComponent <numFichaJugador>().idFicha) - 1, FichaSeleccionada.GetCara()] == 2)
            {
                CambiaObjeto.AsignaAguaBlanca(ficha);
            }

            if (datosFichas[ControlTurno.GetTurnoJugador(), (ficha.GetComponent <numFichaJugador>().idFicha) - 1, FichaSeleccionada.GetCara()] == 3)
            {
                CambiaObjeto.AsignaMaderaBlanca(ficha);
            }
            this.InicializaFicha(ficha, datosFichas);
        }
        bandera = GameObject.FindGameObjectWithTag("BanderaJugador1");
        bandera.GetComponent <MoverBandera>().SetCasillaBandera(5);

        // Añadimos al array todas las fichas y la bandera del jugador 2
        ControlTurno.SetTurnoJugador(1);
        fichas = GameObject.FindGameObjectsWithTag("FichasJugador2");
        //datosFichas = FichaSeleccionada.GetFichasJugadores();
        foreach (GameObject ficha in fichas)
        {
            // recorremos todas las fichas asignando el elemento y añadiendo a las fichas seleccionadas
            if (datosFichas[ControlTurno.GetTurnoJugador(), (ficha.GetComponent <numFichaJugador>().idFicha) - 1, FichaSeleccionada.GetCara()] == 1)
            {
                CambiaObjeto.AsignaFuegoNegro(ficha);
            }

            if (datosFichas[ControlTurno.GetTurnoJugador(), (ficha.GetComponent <numFichaJugador>().idFicha) - 1, FichaSeleccionada.GetCara()] == 2)
            {
                CambiaObjeto.AsignaAguaNegra(ficha);
            }

            if (datosFichas[ControlTurno.GetTurnoJugador(), (ficha.GetComponent <numFichaJugador>().idFicha) - 1, FichaSeleccionada.GetCara()] == 3)
            {
                CambiaObjeto.AsignaMaderaNegra(ficha);
            }
            this.InicializaFicha(ficha, datosFichas);
        }
        bandera = GameObject.FindGameObjectWithTag("BanderaJugador2");
        bandera.GetComponent <MoverBandera>().SetCasillaBandera(20);

        // Preparamos el tueno y el botón de giro
        ControlTurno.SetTurnoJugador(0);
        MoverFicha.DesactivarGiro();
    }
Exemplo n.º 4
0
 // Seleccionamos la cara secundaria
 public void SetCara1()
 {
     FichaSeleccionada.SetCara(1);
 }
Exemplo n.º 5
0
 // Seleccionamos la cara principal
 public void SetCara0()
 {
     FichaSeleccionada.SetCara(0);
 }