Пример #1
0
    void OnMouseDown()
    {
        Comparacion.clicks++;
        currentCarta.VueltaSimbolo();
        print("click " + Comparacion.clicks);
        switch (Comparacion.clicks)
        {
        case 1:
            print("entrando 1");
            comparacion.setCarta1 = this.gameObject;
            currentCarta.DeactiveCollider();            //desactivamos collider
            break;

        case 2:
            print("entrando 2");
            //currentCarta.DeactiveCollider();//desactivo collider 2da carta

            comparacion.setCarta2 = this.gameObject;
            comparacion.setBool   = true;    //activamos bolleano del timer, cuando cumple tiempo ahi se compara

            Comparacion.clicks = 0;          //reset contador

            break;
        }
    }
Пример #2
0
    void DeactiveCollidersCartas()
    {
        Carta c = null;

        for (int i = 0; i < ListaCartas.Count; i++)
        {
            c = ListaCartas[i].GetComponent <Carta>();

            c.DeactiveCollider();
        }
    }
Пример #3
0
    void Update()
    {
        if (GameManager.gameOver == false)
        {
            timeGame += Time.deltaTime;
        }
        if (timeActive)
        {
            time += Time.deltaTime;
            if (time > 0.5f)
            {
                print("tiempo cumplido");

                if (ComparacionCartas())
                {
                    //COMPARACION VERDADERA
                    print("verdadero ");
                    sound.PlaySoundCorrect();                    //SONIDO CORRECTO
                    compC1.DeactiveCollider();                   //DESACTIVO COLLIDER DE LA CARTA 1
                    compC2.DeactiveCollider();                   //IDEM CARTA 2
                    compC1.setBoolSalio = true;                  //BOLEANO INTERNO DE LA CARTA PROPIEDAD Q ESPECIFICA Q SALIO
                    compC2.setBoolSalio = true;                  //IDEM
                    //c1.GetComponent<SetCollider>().enabled=false;//DESATIVO COMPONENTE COLLIDER
                    //c2.GetComponent<SetCollider>().enabled=false;//IDEM
                    //c1.GetComponent<Deteccion>().enabled=false;//IDEM CON DETECCION C1
                    //c2.GetComponent<Deteccion>().enabled=false;//IDEM CON C2
                }
                else
                {
                    //falso cartas disimiles
                    print("incorrecto");

                    sound.PlaySoundInCorrect();
                    compC1.VueltaCarta();
                    compC2.VueltaCarta();
                    print("CARTA 1 " + compC1.getSimbolName);
                    print("CARTA 2 " + compC2.getSimbolName);
                }
                avisoOn();                //aviso a set colliders para q se activen colliders de cartas

                active     = true;
                time       = 0;
                timeActive = false;
                c1         = null;
                c2         = null;
                compC1     = null;
                compC2     = null;
                //RESETEAMO LOS VALORES
            }
        }
    }