public IEnumerator drawPhase() { List <PlayerCard> drawnCards = new List <PlayerCard>(); try { drawnCards.Add(playerDeck.Pop()); drawnCards.Add(playerDeck.Pop()); } catch (InvalidOperationException) { gameFlowManager.gameOver(Vals.GAME_OVER_CARDS); } boardUI.setPlayerDeckCount(playerDeck.Count); yield return(StartCoroutine(cardUI.playerDraw(playerManager.getCurPlayer(), drawnCards[0], drawnCards[1]))); foreach (PlayerCard drawn in drawnCards) { Debug.Log("Player draws " + drawn.getName()); if (drawn.getId() == Vals.EPIDEMIC) { // Increase Step infectionRateTrackIndex++; boardUI.advanceInfectionRateTrack(); // Infect Step InfectionCard epidemicDrawn = epidemicInfectionCards.Pop(); Location loc = epidemicDrawn.getLocation(); infectionDiscardPile.Add(epidemicDrawn); yield return(StartCoroutine(cardUI.infectionDraw(loc.getName(), loc.getColour()))); if (diseaseStatus[(int)loc.getColour()] < Vals.DISEASE_ERADICATED) { for (int j = 0; j < Vals.CUBES_PER_EPIDEMIC_INFECT; j++) { yield return(StartCoroutine(addCube(loc, loc.getColour()))); } } outbreakCitiesThisMove.Clear(); //Intensify Step Utils.ShuffleAndPlaceOnTop(infectionDiscardPile, infectionDeck); } else { if (drawn.getColour() == Vals.Colour.EVENT) { availableEventCards.Add(drawn); Debug.Log("Event drawn"); } playerManager.drawPhaseAdd(drawn); } } yield return(StartCoroutine(playerManager.checkHandLimit(playerManager.getCurPlayer()))); }
//load next question IEnumerator nextPicture() { //print("next picture!"); if (wordTotal == images.Length) { gameFlowManager.gameOver(); } wordTotal++; //If it's played more than one turn if (wordIndex != 0) { yield return(new WaitForSeconds(1f)); } wordIndex = 0; //Debug.Log("Next question"); string pictureName = getWords(); if (pictureName.Equals("end")) { yield return(null); } //Debug.Log(pictureName); getImage(pictureName); banner.loadInputField(pictureName); //Debug.Log("banner改变了"); }