Ejemplo n.º 1
0
    /// <summary>
    /// Raises the pointer click event.
    /// Toggles the TTS button.
    /// </summary>
    /// <param name="eventData">Event data.</param>
    public void OnPointerClick(PointerEventData eventData)
    {
        // Start speaking
        if (showingPlayOption && sentence.transform.childCount > 0)
        {
            textToSpeechHandler.startSpeaking(sentence.getSentenceText());
        }

        // Stop speaking
        else if (!showingPlayOption)
        {
            textToSpeechHandler.stopSpeaking();
        }
    }
Ejemplo n.º 2
0
 /// <summary>
 /// Raises the pointer click event.
 /// When a word tile is clicked it should have its text spoken by TTS.
 /// </summary>
 /// <param name="eventData">Event data.</param>
 public void OnPointerClick(PointerEventData eventData)
 {
     // Speak the word on the tile
     textToSpeechHandler.startSpeaking(eventData.pointerPress.GetComponent <WordTile> ().getText());
 }
Ejemplo n.º 3
0
 public void OnPointerClick(PointerEventData eventData)
 {
     // Speak the completed sentence
     textToSpeechHandler.startSpeaking(eventData.pointerPress.transform.GetChild(0).GetComponent <Text> ().text);
 }