private void GameWin() { closeUILoss = true; UIStatus.SetActive(false); UIEnd.SetActive(true); textWorL.text = "WINNER"; textResult.text = "YOUR POINT IS: " + point; StartCoroutine(Wait(7, 0)); start = false; }
//Question mode selection public void ButtonQuestion() { start = true; UI.SetActive(true); UIStatus.SetActive(true); UIAdd.SetActive(true); UIChoose.SetActive(false); timeMore = Time.time; StartCoroutine(wait(2, 1f)); noteText.text = "Your task is to answer questions to move to objects!"; }
//Auto mode selection public void ButtonAuto() { StopAllCoroutines(); UIChoose.SetActive(false); UI.SetActive(false); autoMove = true; start = false; UIAdd.SetActive(true); UIConver.SetActive(false); UIStatus.SetActive(false); indexAuto = 0; }
//start private void Start() { audioSource = GetComponent <AudioSource>(); if (keywords != null) { recognizer = new KeywordRecognizer(keywords, confidence); recognizer.OnPhraseRecognized += Recognizer_OnPhraseRecognized; recognizer.Start(); } //UI start Randoms(); pointText.text = " 0 "; UiEnd.SetActive(false); UIStatus.SetActive(false); UI.SetActive(false); UIChoose.SetActive(false); UIAdd.SetActive(false); UIConver.SetActive(false); }
//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 = ""; } } }
public void Close() { UIStatus.SetActive(false); }
private void OnMouseDown() { UIStatus.SetActive(true); }