void Start() //Setup dialogue boxes { dialogBox.SetActive(false); playerBox.SetActive(false); NPCBox.SetActive(false); recordIcon.SetActive(false); WordBox.SetActive(true); finishBox.SetActive(false); dialogue_content = textBox.GetComponent <TextMeshProUGUI>(); playerContent = playerText.GetComponent <TextMeshProUGUI>(); NPCContent = NPCText.GetComponent <TextMeshProUGUI>(); GrammarMessage = grammarBox.GetComponent <TextMeshProUGUI>(); inputRelevanceText = inputRelevance.GetComponent <TextMeshProUGUI>(); GrammarMessage.text = ""; WordListContent = wordList.GetComponent <TextMeshProUGUI>(); // Word list of words to be covered in level 1 LoadQuestions(); words = new string[WORD_LIST_LENGH]; words[0] = "recover"; words[1] = "member"; words[2] = "grow"; //words[3] = "worry"; //words[4] = "grow"; WordListContent.text = ""; RefreshWordList(); grammarBot = new GrammarBotClient.GrammarBot(new GrammarBotClient.ApiConfig()); }
void Start() { dialogBox.SetActive(false); playerBox.SetActive(false); NPCBox.SetActive(false); recordIcon.SetActive(false); WordBox.SetActive(true); finishBox.SetActive(false); dialogue_content = textBox.GetComponent <TextMeshProUGUI>(); playerContent = playerText.GetComponent <TextMeshProUGUI>(); NPCContent = NPCText.GetComponent <TextMeshProUGUI>(); GrammarMessage = grammarBox.GetComponent <TextMeshProUGUI>(); inputRelevanceText = inputRelevance.GetComponent <TextMeshProUGUI>(); finishMessageText = finishMessage.GetComponent <TextMeshProUGUI>(); scoreText = scoreInList.GetComponent <TextMeshProUGUI>(); scoreText2 = scoreInBox.GetComponent <TextMeshProUGUI>(); GrammarMessage.text = ""; userLogPath = Application.dataPath + "/Scripts/userLog.txt"; userScorePath = Application.dataPath + "/Scripts/userScore.txt"; WordListContent = wordList.GetComponent <TextMeshProUGUI>(); File.WriteAllText(userLogPath, ""); if (!File.Exists(userScorePath)) { File.WriteAllText(userScorePath, "0"); } scoreTotal = double.Parse(File.ReadAllText(userScorePath)); if (scoreTotal >= scoreHard && SceneManager.GetActiveScene().name != "T1") { SceneManager.LoadScene("T1"); } scoreRound = 0.0; scoreText.text = "Total Score: " + scoreTotal.ToString("F0") + "\n" + "Round Score: " + scoreRound.ToString("F0"); LoadQuestions(scoreTotal); loadWords(scoreTotal); WordListContent.text = ""; RefreshWordList(); grammarBot = new GrammarBotClient.GrammarBot(new GrammarBotClient.ApiConfig()); }
// Start is called before the first frame update void Start() { grammarBot = new GrammarBotClient.GrammarBot(new GrammarBotClient.ApiConfig()); Check(); }