コード例 #1
0
ファイル: RuleSet.cs プロジェクト: istrk33/poker-game-ui
 private void Victory(Player player)
 {
     if (gameOver)
     {
         return;
     }
     player.Gain(pot);
     GameControler.DisplayDealWon(player.Name, pot);
     if (OtherPlayers.All(p => p.Money <= 0 || p.PlayerStatus == PlayerStatus.OutGame))
     {
         Winner = player;
         GameControler.GameOver();
     }
 }
コード例 #2
0
    /// <summary>
    /// Check the count of living players, if there is no player alive, reload the scene
    /// </summary>
    public IEnumerator CheckLivingPlayers()
    {
        if (!PhotonNetwork.offlineMode && localPlayer.IsDead)
        {
            yield return(new WaitForSeconds(2f));

            //TDS_UIManager.Instance.ResetUIManager();
            if (OtherPlayers.All(p => p.IsDead))
            {
                TDS_UIManager.Instance.StartCoroutine(TDS_UIManager.Instance.ResetInGameUI());
            }
            else if (OtherPlayers.Count > 0)
            {
                TDS_Camera.Instance.Target = OtherPlayers.Where(p => !p.IsDead).First().transform;
            }
            yield break;
        }
        else if (AllPlayers.All(p => p.IsDead))
        {
            TDS_UIManager.Instance.StartCoroutine(TDS_UIManager.Instance.ResetInGameUI());
        }
    }