Example #1
0
    void Update()
    {
        if (pasarJug == null)
        {
            pasarJug = GameObject.FindWithTag("PASAR");
        }


        if (puntajesC == null)
        {
            puntajesC = GameObject.Find("objetoPuntaje").GetComponent <almacenaPuntajesTRES>();
        }

        if (codigoTiempo.reloj == 0)
        {
            if (puntajesC.jugador1 == 0)
            {
                puntajesC.jugador1 = puntaje;
                pasarJug.SetActive(true);
                martillo.SetActive(false);
            }
            else if (puntajesC.jugador2 == 0)
            {
                puntajesC.jugador2 = puntaje;
                pasarJug.SetActive(true);
                martillo.SetActive(false);
            }
            else if (puntajesC.jugador3 == 0)
            {
                puntajesC.jugador3 = puntaje;
                martillo.SetActive(false);
            }
        }
    }
 void Start()
 {
     verdes        = 0;
     otros         = 0;
     final         = 0;
     cañaVerde     = GameObject.Find("CañaVerde");
     objetoPuntaje = GameObject.Find("objetoPuntaje");
     puntajes      = objetoPuntaje.GetComponent <almacenaPuntajesTRES>();
 }
Example #3
0
 void Start()
 {
     puntaje      = 0;
     puntajesC    = GameObject.Find("objetoPuntaje").GetComponent <almacenaPuntajesTRES>();
     codigoTiempo = GameObject.Find("tiempo").GetComponent <tiempo>();
     pasarJug     = GameObject.FindWithTag("PASAR");
     pasarJug.SetActive(false);
     martillo = GameObject.Find("martillo");
     martillo.SetActive(true);
 }
 void Start()
 {
     //Encontramos los objetos y códigos
     objetoPuntaje  = GameObject.Find("objetoPuntaje");
     puntajes       = objetoPuntaje.GetComponent <almacenaPuntajesTRES>();
     secondsCounter = 0;
     pasarJug       = GameObject.FindWithTag("PASAR");
     //Desactivamos el texto que indica el siguiente jugador
     pasarJug.SetActive(false);
 }
    void Start()
    {
        //Al inicio todos  son cero
        amarillos = 0;
        otros     = 0;
        final     = 0;

        //Encontramos la caña, el objeto puntaje y el código de los puntajes
        cañaAmarilla  = GameObject.Find("CañaAmarilla");
        objetoPuntaje = GameObject.Find("objetoPuntaje");
        puntajes      = objetoPuntaje.GetComponent <almacenaPuntajesTRES>();
    }
Example #6
0
 void Start()
 {
     //Encontramos los objetos y componentes
     objetoTexto = GameObject.Find("objetoTexto");
     texto       = objetoTexto.GetComponent <Text>();
     puntaje     = GameObject.Find("objetoPuntaje").GetComponent <almacenaPuntajesTRES>();
     //Inicia en cero
     secondsCounter = 0;
     panelControl   = GameObject.Find("panel_Teclado");
     calculando     = GameObject.FindWithTag("CALCULANDO");
     //Desactivamos tanto el panel de calculando y el panel del ganador
     calculando.SetActive(false);
     panelGanador = GameObject.Find("panelGanador");
     panelGanador.SetActive(false);
 }
    void Update()
    {
        //Verificamos que los objetos hayan sido encontrados
        if (pasarJug == null)
        {
            pasarJug = GameObject.FindWithTag("PASAR");
        }
        if (objetoPuntaje == null)
        {
            objetoPuntaje = GameObject.Find("objetoPuntaje");
        }
        if (puntajes == null)
        {
            puntajes = objetoPuntaje.GetComponent <almacenaPuntajesTRES>();
        }

        //Muestra en consola los 3 puntajes
        Debug.Log("1:" + puntajes.jugador1 + ", 2:" + puntajes.jugador2 + ", 3:" + puntajes.jugador3);

        //Si el jugador 1 ya tiene un puntaje almacenado, y el turno es el 2
        if (puntajes.jugador1 != 0 && puntajes.turno == 2)
        {
            Debug.Log("ENTRA 1");
            //Ejecute el método, enviándole el turno=3
            metodoEspera(3);
            //Active el texto del siguiente jugador
            pasarJug.SetActive(true);
        }

        //Si el jugador 2 ya tiene un puntaje almacenado, y el turno es el 3
        else if (puntajes.jugador2 != 0 && puntajes.turno == 3)
        {
            Debug.Log("ENTRA 2");
            //Ejecute el método, enviándole el turno 4
            metodoEspera(4);
            //Active el texto del siguiente jugador
            pasarJug.SetActive(true);
        }

        //Si el jugador 3 ya tiene almacenado un puntaje, y el turno es el 4
        else if (puntajes.jugador3 != 0 && puntajes.turno == 4)
        {
            Debug.Log("ENTRA 3");
            //Ejecute el método, enviandole el turno 0
            metodoEspera(0);
            //Como es el último jugador, ya no se carga el texto de siguiente jugador, sino el calculando ganador
        }
    }
Example #8
0
 void Update()
 {
     if (codigoTiempo == null)
     {
         codigoTiempo = GameObject.Find("tiempo").GetComponent <tiempo>();
     }
     if (puntajes == null)
     {
         puntajes = GameObject.Find("objetoPuntaje").GetComponent <almacenaPuntajesTRES>();
     }
     if (codigoTiempo.reloj <= 0)
     {
         Debug.Log("ENTRA 1");
         metodoEspera();
     }
 }
Example #9
0
 // Start is called before the first frame update
 void Start()
 {
     secondsCounter = 0;
     codigoTiempo   = GameObject.Find("tiempo").GetComponent <tiempo>();
     puntajes       = GameObject.Find("objetoPuntaje").GetComponent <almacenaPuntajesTRES>();
 }