/// <summary> /// 次の手番に移るコルーチンです /// </summary> /// <returns>The turn coroutine.</returns> IEnumerator NextTurnCoroutine() { if (field.CountStone(Game_Field.StoneColor.None) == 0) { yield return(message.Show("Game FINISHED")); StartCoroutine(GameFinishedCoroutine()); } else { IncrementTurnNumber(); if (field.CountClickableCells() == 0) { yield return(message.Show(string.Format("{0} cannot put stone. Turn Skipped", CurrentPlayerStoneColor.ToString()))); IncrementTurnNumber(); if (field.CountClickableCells() == 0) { yield return(message.Show(string.Format("{0} cannot put stone too. Game Finished", CurrentPlayerStoneColor.ToString()))); StartCoroutine(GameFinishedCoroutine()); } } } }
/// <summary> /// 次の手番に移るコルーチンです /// </summary> /// <returns>The turn coroutine.</returns> IEnumerator NextTurnCoroutine() { if (field.CountStone(Game_Field.StoneColor.None) == 0) { //マスがすべて埋まったならゲーム終了 yield return(message.Show("GAME FINISHED")); StartCoroutine(GameFinishedCoroutine()); } else { IncrementTurnNumber(); if (field.CountClickableCells() == 0) { //石を置ける場所が無いならパス yield return(message.Show(string.Format("{0} cannot put stone. TURN SKIPPED", CurrentPlayerStoneColor.ToString()))); IncrementTurnNumber(); if (field.CountClickableCells() == 0) { //もう一方も石を置ける場所が無いならゲーム終了 yield return(message.Show(string.Format("{0} cannot put stoen too. GAME FINISHED", CurrentPlayerStoneColor.ToString()))); StartCoroutine(GameFinishedCoroutine()); } } } }