Esempio n. 1
0
        public void GameEnd(GameEndType endType, string message = "")
        {
            isPlaying = false;
            quizQue   = null;

            StopAllCoroutines();
            RemoveMouseTracker();

            List <PlayerItem> playerList = mainUI.GetPlayerListOrderByScore();

            string winnerName = playerList[0].nameText.text;
            int    score      = playerList[0].Score;

            if (endType == GameEndType.Interrupted)
            {
                ShowInterrupMessage(message);
            }
            else if (score == 0 || score == playerList[1].Score)
            {
                ShowResultDraw();
            }
            else
            {
                ShowResult(winnerName);
                RecordWinLose(PhotonNetwork.LocalPlayer, PhotonNetwork.NickName.Equals(winnerName));
            }

            mainUI.GameEnd();
            FindObjectOfType <Main.Drawing.DrawingToolUI>().ColorBtnAllDeSelected();
            PhotonNetwork.CurrentRoom.IsVisible = true;
        }