//Game Winner public void GameWinner() { UiEnd.SetActive(true); start = false; rotateCamera = true; closeUILoss = true; pointEnd.text = ""; textWorL.text = "WINNER!!!"; textEnd.text = "Tổng thời gian trả lời của bạn : " + (Time.time - timeMore) + "s" + "\n => Bạn giỏi VC"; pointEnd.text = "Point : " + point; pointEnd.color = Color.blue; StartCoroutine(SetActiveUI(7, UiEnd, false)); noteText.text = "You can view rooms by pressing key A, D, W, S to move"; StopAllCoroutines(); checkClickOBJ = true; }
//Game Loss public void GameLoss() { if (Time.time == (100f + Mathf.Round(timeMore)) && start == true) { UiEnd.SetActive(true); audioSource.PlayOneShot(audioClips[3], 1f); StartCoroutine(wait(4, 2)); textWorL.text = "LOSE"; textEnd.text = "Hết thời gian !!!" + "\n => Bạn ngu VC"; pointEnd.text = "Point : " + point; pointEnd.color = Color.blue; start = false; UI.SetActive(false); //rotateCamera = true; StartCoroutine(SetActiveUI(7, UiEnd, false)); } }
//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); }