private void WinOrLoss() { if (!closeUILoss) { GameLoss(); } else { UIQuestion.SetActive(false); if (word == "Restart") { Restart(); word = ""; } } }
//Check Robot or Not private void GoOrNot() { if (word == "Absolutely") { if (!start) { StartCoroutine(Wait(2, 0)); UIDoor.SetActive(false); UIQuestion.SetActive(true); UIStatus.SetActive(true); RandomQuestion(); StartCoroutine(MoveCam()); StartCoroutine(Wait(3, 4)); timeStart = Time.time; start = true; } word = ""; } if (word == "Yes" || word == "Definitely") { if (!start) { count++; if (count < 3) { StartCoroutine(Wait(12, 0)); } else if (count == 3) { Debug.Log("You are a Robot"); StartCoroutine(Wait(10, 0)); StartCoroutine(Quit()); } word = ""; } } }
private void GameLoss() { if (Time.time == 80 + Mathf.Round(timeStart)) { if (!closeUILoss) { UIQuestion.SetActive(false); UIStatus.SetActive(false); UIEnd.SetActive(true); textWorL.text = "LOSER"; textResult.text = "YOUR POINT IS: " + point; StartCoroutine(Wait(6, 0)); start = false; } } else if (Time.time >= 80 + Mathf.Round(timeStart)) { if (word == "Restart") { Restart(); word = ""; } } }
private void Handle() { if (start) { for (int i = 0; i < 16; i++) { if (i < 8) { if (word == keywordsY[index]) { RandomQuestion(); if (!closeUILoss) { StartCoroutine(MoveCam()); StartCoroutine(Wait(13, 0)); StartCoroutine(Wait(5, 0.5f)); StartCoroutine(Wait(3, 3)); UIQuestion.SetActive(false); StartCoroutine(SetActiveUIQuestion(2, UIQuestion, true)); } point += 10; word = ""; } } if (word == keywordsN[i]) { StartCoroutine(Wait(14, 0)); StartCoroutine(Wait(4, 0.5f)); point -= 7; word = ""; } } } }