Beispiel #1
0
        public void Results(PlayersManager.Result result)
        {
            if (result == PlayersManager.Result.Draw)
            {
                player0.GetComponent <MyEventSystem>().enabled = false;
                player1.GetComponent <MyEventSystem>().enabled = false;

                StartCoroutine(EndGameAnimations(-1));
            }
        }
Beispiel #2
0
    private void SetText(PlayersManager.Result result)
    {
        switch (result)
        {
        case PlayersManager.Result.Draw:
            textDisplay.text = "It's a draw!";
            break;

        case PlayersManager.Result.LeftWin:
            textDisplay.text = "Left player won!";
            medleyManager.AddScoreToPlayer(MedleyRandomizer.currentMatchup.leftPlayer);
            break;

        case PlayersManager.Result.RightWin:
            textDisplay.text = "Right player won!";
            medleyManager.AddScoreToPlayer(MedleyRandomizer.currentMatchup.rightPlayer);
            break;
        }
    }
Beispiel #3
0
        void EndMinigame(PlayersManager.Result result)
        {
            Debug.Log(result.ToString());

            if (result == PlayersManager.Result.LeftWin)
            {
                PlayersManager.result = PlayersManager.Result.LeftWin;
                playerLeft.Win();
                playerRight.Die();
                MoveCameraToPlayer(playerLeft.transform);
            }
            else if (result == PlayersManager.Result.RightWin)
            {
                PlayersManager.result = PlayersManager.Result.RightWin;
                playerLeft.Die();
                playerRight.Win();
                MoveCameraToPlayer(playerRight.transform);
            }
            else
            {
                PlayersManager.result = PlayersManager.Result.Draw;

                if (playerRight.winning && playerLeft.winning)
                {
                    playerLeft.Win();
                    playerRight.Win();
                }
                else
                {
                    Destroy(playerRight);
                    Destroy(playerLeft);
                }
            }

            StartCoroutine(DelayToTransition());
        }