Exemplo n.º 1
0
 public void SetGameResult(WinResultEnum winResult)
 {
     if (winResult == WinResultEnum.Draw)
     {
         _txtPlayerWinResult.gameObject.SetActive(false);
         _txtWinResult.text = "DRAW !";
     }
     else
     {
         _txtPlayerWinResult.gameObject.SetActive(true);
         _txtWinResult.text       = "WIN !";
         _txtPlayerWinResult.text = (winResult == WinResultEnum.Player1 ? "Player 1" : "Player 2");
     }
     _anmtrGameResult.SetTrigger("Show");
     _anmtrPlayerTurn.gameObject.SetActive(false);
     ResetValues(GameState.player1WinCount, GameState.player2WinCount);
 }
Exemplo n.º 2
0
    private IEnumerator RoutineAwaitShow(WinResult winResult = null)
    {
        yield return(new WaitForSeconds(0.5f));

        WinResultEnum result = WinResultEnum.Draw;

        if (winResult != null)
        {
            if (winResult.cellType == CellType.Cross)
            {
                result = (users[0].playerTypeFigure == PlayerTypeFigure.Cross ? result = WinResultEnum.Player1 : result = WinResultEnum.Player2);
            }
            else
            {
                result = (users[0].playerTypeFigure == PlayerTypeFigure.Circle ? result = WinResultEnum.Player1 : result = WinResultEnum.Player2);
            }
        }
        _controllerUiGame.SetGameResult(result);
    }