Esempio n. 1
0
 private void GenerateWords()
 {
     foreach (var word in words)
     {
         var        formattedWord = FormatWord(word);
         GameObject wordObject;
         if (PronounValues.GetWrongPronouns1().Contains(formattedWord))
         {
             wordObject = Instantiate(pronounPrefab1);
             formNavigator.inputs.Add(wordObject);
         }
         else if (PronounValues.GetWrongPronouns2().Contains(formattedWord))
         {
             wordObject = Instantiate(pronounPrefab2);
             formNavigator.inputs.Add(wordObject);
         }
         else
         {
             wordObject = Instantiate(wordPrefab);
         }
         wordObject.GetComponent <TMPro.TextMeshProUGUI>().text = word;
         wordGrid.Add(wordObject);
     }
     formNavigator.inputs.Add(GameObject.Find("NextSceneArrowButton"));
     GenerateGrid();
 }
Esempio n. 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"));
 }
Esempio n. 3
0
    //TODO choose a random set of wrong pronouns?
    public static List <string> AddWrongPronounsToArray(string[] copyList)
    {
        List <string> newCopyList = new List <string>();

        foreach (var text in copyList)
        {
            string newText = "";
            newText = text.Replace("(wrongPronoun1)", PronounValues.GetWrongPronouns1()[1]);
            newText = newText.Replace("(wrongPronoun2)", PronounValues.GetWrongPronouns2()[1]);
            newCopyList.Add(newText);
        }
        return(newCopyList);
    }
Esempio n. 4
0
 public static string AddWrongPronounsToString(string copy)
 {
     return(copy.Replace("(wrongPronoun1)", PronounValues.GetWrongPronouns1()[1])
            .Replace("(wrongPronoun2)", PronounValues.GetWrongPronouns2()[1]));
 }
Esempio n. 5
0
    void SetWrongPronoun()
    {
        string wrongPronoun = PronounValues.GetWrongPronouns1() [0];

        pronoun.GetComponentInChildren <TMPro.TextMeshProUGUI> ().text = wrongPronoun;
    }