//GameOver function stops all coroutines and calls DestroyAll Coroutine from BoardScript. //It is used for end game. It is called if bomb tick is reached 0 or there is a deadlock. public void GameOver() { BoardScript board = FindObjectOfType <BoardScript>(); StopAllCoroutines(); StartCoroutine(board.DestroyAll()); inGameUI.SetActive(false); board.gameObject.SetActive(false); gameOverUI.SetActive(true); gameOverUI.transform.FindChild("ScoreText").GetComponent <Text>().text = FindObjectOfType <ScoreScript>().score.ToString(); }