Example #1
0
 public void OnSubmit()
 {
     PronounValues.SetPronoun1(pronoun1.text);
     PronounValues.SetPronoun2(pronoun2.text);
     Debug.Log("submitting " + PronounValues.GetRightPronoun1() + PronounValues.GetRightPronoun2());
     if (OnPronounSubmit != null)
     {
         OnPronounSubmit();
     }
 }
Example #2
0
 private void CorrectAllPronouns()
 {
     GameObject[] speechBubbles = GameObject.FindGameObjectsWithTag("Speech");
     foreach (var speech in speechBubbles)
     {
         string speechText = speech.GetComponentInChildren <TMPro.TextMeshProUGUI> ().text;
         speechText = speechText.Replace(PronounValues.GetWrongPronouns1() [1], PronounValues.GetRightPronoun1());
         speechText = speechText.Replace(PronounValues.GetWrongPronouns2() [1], PronounValues.GetRightPronoun2());
         speech.GetComponentInChildren <TMPro.TextMeshProUGUI> ().text = speechText;
     }
     formNavigator.inputs.Add(GameObject.Find("NextSceneArrowButton"));
 }
Example #3
0
 private void SetCorrectPronoun()
 {
     correctPronoun = PronounValues.GetRightPronoun1();
 }
Example #4
0
    public void Interrupt()
    {
        if (OnInterruption != null)
        {
            OnInterruption();
        }
        //TODO put this in CopyFormatter
        string     formattedInterruption = SpeechCopy.interruption.Replace("(rightPronoun1)", PronounValues.GetRightPronoun1()).Replace("(rightPronoun2)", PronounValues.GetRightPronoun2());
        GameObject interrupt             = Instantiate(interruption);

        interrupt.GetComponentInChildren <TMPro.TextMeshProUGUI> ().text = formattedInterruption;
        interrupt.transform.SetParent(gameObject.transform, false);
        interrupt.transform.SetSiblingIndex(interruptIndex);

        GameObject apology = Instantiate(speechBubble);

        apology.GetComponent <Image> ().sprite = apologySprite;
        apology.GetComponentInChildren <TMPro.TextMeshProUGUI> ().text = SpeechCopy.apologies[0];
        apology.transform.SetParent(gameObject.transform, false);
        apology.transform.SetSiblingIndex(interruptIndex + 1);
        SetHeightOfSpeechBubble(apology.transform);

        ++interruptCount;

        bool interruptionComplete = interruptCount >= 3;

        if (interruptionComplete)
        {
            CorrectAllPronouns();
        }

        StartCoroutine(StopScroll(interruptionComplete));
    }