コード例 #1
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");
         }
     }
 }