private IEnumerator endGame(Controller.GAMESTATE gamestate) { Debug.Log("endgame"); //reveal all the mines first foreach (Block b in allMines) { b.showBlockSprite(gamestate); yield return(new WaitForSeconds(animDelay)); } //reveal no mine blocks foreach (Block b in nonMines) { b.showBlockSprite(gamestate); yield return(new WaitForSeconds(animDelay)); } }
//show block sprite public void showBlockSprite(Controller.GAMESTATE gameState) { switch (gameState) { case Controller.GAMESTATE.PLAYERMOVE: { showPlaySprite(); } break; case Controller.GAMESTATE.WON: { showWinSprite(); } break; case Controller.GAMESTATE.LOST: { showLoseSprite(); } break; } }