示例#1
0
 public void reproducirInstrucciones()
 {
     foreach (GameObject txt in allTexts)
     {
         string instruccion = txt.GetComponent <Text>().text;
         audioController.speak(instruccion);
     }
 }
示例#2
0
    IEnumerator showAnimalCourutine(Animal _animal, int _randomNumber)
    {
        setImage(_animal.name);
        showHidePopUp(true);
        nameOfAnimal.text  = Constantes.FirstLetterToUpper(_animal.name);
        soundOfAnimal.text = "Sonido: " + _animal.sound + "!";
        audioController.speak(_animal.name);
        audioController.playSounds(_animal.name);
        animalList.RemoveAt(_randomNumber);

        yield return(new WaitForSeconds(optionsContoller.getGameSpeed()));

        finishShowingAnimal();

        if (_animal.name == "pato")
        {
            gameOver = true;
            yield return(new WaitForSeconds(1f));

            showHidePopUp(true);
            nameOfAnimal.text         = "¡Vuelve a intentarlo!";
            soundOfAnimal.text        = "";
            imageOfAnimalPopUp.sprite = Resources.Load <Sprite>("animo");
            yield return(new WaitForSeconds(4f));

            finishShowingAnimal();
            restaurarJuego();
        }

        if (contadorAnimales == 16)
        {
            gameOver = true;
            yield return(new WaitForSeconds(1f));

            showHidePopUp(true);
            nameOfAnimal.text  = "¡Has ganado!";
            soundOfAnimal.text = "Enhorabuena";
            audioController.speak("Enhorabuena");
            audioController.playSounds("aplausos");
            imageOfAnimalPopUp.sprite = Resources.Load <Sprite>("gana");
            yield return(new WaitForSeconds(4f));

            finishShowingAnimal();
            restaurarJuego();
        }
    }
示例#3
0
 public void OnPointerDown(PointerEventData data)
 {
     if (gameObject.name == "Instrucciones")
     {
         if (botonControles.activeInHierarchy)
         {
             audioController.speak(gameObject.transform.GetComponentInChildren <Text>().text);
             panelInstrucciones.SetActive(true);
             botonControles.SetActive(false);
             botonInstrucciones.GetComponentInChildren <Text>().text = "Cerrar";
             imageInstruction.sprite = Resources.Load <Sprite>("close");
             instructionsController  = GameObject.Find("ControladorInstrucciones").GetComponent <InstructionsController>();
             instructionsController.reproducirInstrucciones();
         }
         else
         {
             audioController.stopSpeak();
             panelInstrucciones.SetActive(false);
             botonControles.SetActive(true);
             botonInstrucciones.GetComponentInChildren <Text>().text = "Instrucciones";
             imageInstruction.sprite = Resources.Load <Sprite>("info");
             audioController.speak(GameObject.FindGameObjectWithTag("TituloPantallaJuego").GetComponent <Text>().text);
         }
     }
     else if (gameObject.name == "Controles")
     {
         if (botonInstrucciones.activeInHierarchy)
         {
             audioController.speak(gameObject.transform.GetComponentInChildren <Text>().text);
             panelControles.SetActive(true);
             botonInstrucciones.SetActive(false);
             botonControles.GetComponentInChildren <Text>().text = "Cerrar";
             imageControl.sprite = Resources.Load <Sprite>("close");
         }
         else
         {
             audioController.speak(GameObject.FindGameObjectWithTag("TituloPantallaJuego").GetComponent <Text>().text);
             panelControles.SetActive(false);
             botonInstrucciones.SetActive(true);
             botonControles.GetComponentInChildren <Text>().text = "Controles";
             imageControl.sprite = Resources.Load <Sprite>("settings");
         }
     }
 }