Example #1
0
        public IEnumerator _GameOver(bool won)
        {
            if (gameOver)
            {
                yield break;                            //stop the coroutine if it has already been called
            }
            gameOver = true;

            Debug.Log("game over - " + (won ? "win" : "lost"));

            //delay 1.5 second before issuing a global gameover event
            yield return(new WaitForSeconds(1.5f));

            gameState = _GameState.GameOver;
            TDS.GameOver(won);
        }