コード例 #1
0
    public static void ResetHand(int winner, UnityRound currentRound, Player winnerPlayer)
    {
        if (Properties.ActiveGameType == GameType.SinglePlayer)
        {
            destinationPosition = playerPositions[winner].position;
            destinationRotation = playerPositions[winner].rotation;
        }
        else
        {
            int networkWinnerSeat = LocalNetworkPlayer.GetRelativePlayerSeat(winner);
            destinationPosition = playerPositions[networkWinnerSeat].position;
            destinationRotation = playerPositions[networkWinnerSeat].rotation;
        }

        unityRound = currentRound;

        playedCardCount = 0;
        PlayedCardsController.awaitingWinner = winnerPlayer;

        moveCards = true;

        TurnArrowController.TurnArrowOff();
    }
コード例 #2
0
 public void SetCurrentRound(UnityRound unityRound)
 {
     this.currentRound = unityRound;
 }
コード例 #3
0
ファイル: ScoreBoard.cs プロジェクト: JnRMnT/SpadesJM.UI
    void OnGUI()
    {
        GUI.depth = 20;
        GUI.skin  = scoreboardSkin;

        if ((Game.Actors.ScoreBoard.gameTable.GetGameInstance() as UnityGame) == null)
        {
            return;
        }

        GUI.BeginGroup(scorePopupPos);
        GUI.Box(new Rect(0, 0, scorePopupPos.width, scorePopupPos.height), "");

        UnityRound        round        = ((Game.Actors.ScoreBoard.gameTable.GetGameInstance() as UnityGame).GetCurrentRound() as UnityRound);
        UnityInitialPhase initialPhase = null;

        RoundScore[] biddings = null;
        if (round != null)
        {
            initialPhase = round.GetInitialPhase();
        }
        if (initialPhase != null)
        {
            biddings = initialPhase.GetRoundScores();
        }


        if (biddings != null)
        {
            float offsetY = scorePopupPos.height / 12;
            GUI.Label(new Rect(0, offsetY, scorePopupPos.width, scorePosition.height), LanguageManager.getString("SCRBRD"));
            offsetY += scorePopupPos.height / 6;

            for (int i = 0; i < 4; i++)
            {
                var score      = Game.Actors.ScoreBoard.GetPlayerScore(i);
                var playerName = Game.Actors.ScoreBoard.gameTable.GetPlayerSeatedAt(i).PlayerName;

                var said = biddings[i].GetSaid();
                var bid  = "";
                if (said == -2)
                {
                    bid = "-";
                }
                else if (said == -1)
                {
                    bid = LanguageManager.getString("PASS");
                }
                else
                {
                    bid = said.ToString();
                }

                GUI.Box(new Rect(scorePopupPos.width / 8, offsetY, scorePopupPos.width - scorePopupPos.width / 4, scorePosition.height * 2), "");
                GUI.Label(new Rect(scorePosition.x, offsetY, scorePosition.width, scorePosition.height), playerName);
                GUI.Label(new Rect(scorePosition2.x, offsetY, scorePosition2.width, scorePosition.height), bid);
                offsetY += scorePosition.height;
                GUI.Label(new Rect(scorePosition.x, offsetY, scorePopupPos.width, scorePosition.height), LanguageManager.getString("SCR") + ": " + score.ToString());
                offsetY += scorePosition.height;
            }
        }


        if (!timed)
        {
            if (GUI.Button(buttonPosition, "X"))
            {
                if (EndGamePopup.IsActive)
                {
                    EndGamePopup.DialogBoxCallback(true);
                }
                Hide();
            }
        }

        GUI.EndGroup();
    }