Exemple #1
0
 public static ListResultXuongView Create(string correct, string incorrect, int point, string textGa, Electrotank.Electroserver5.Api.EsObject [] listObj, string infoFullaying)
 {
     if (_instance == null)
     {
         GameObject obj = (GameObject)GameObject.Instantiate(Resources.Load("Prefabs/Gameplay/CuocU/ListResultXuongPrefab"));
         obj.name = "__ListResult";
         obj.transform.position = new Vector3(3, 68, -129f);
         _instance = obj.GetComponent <ListResultXuongView>();
         _instance.Init(correct, incorrect, point, textGa, listObj, infoFullaying);
         GameModelChan.HideAvatarPlayer(true);
     }
     return(_instance);
 }
Exemple #2
0
    /// <summary>
    /// Hiện thông tin, kết quả khi hết trận.
    /// </summary>
    private IEnumerator _FinishGame()
    {
        #region SHOW OTHER HAND
        foreach (PlayerControllerChan p in GameModelChan.ListPlayerInGame)
        {
            if (GameModelChan.YourController != null && p.slotServer == YourController.slotServer)
            {
                continue;
            }

            //Đặt những card ăn vào danh sách card của bản thân (Fix trường hợp có người Ù giữa trận card ăn bị kẹt chèn đè lên)
            p.mCardHand.ForEach(c => { c.originSide = c.currentSide; c.originSlot = c.currentSlot; });

            List <int> lst = new List <int>();
            while (p.summary.inHand.Count > 0)
            {
                if (p.mCardHand.Find(c => c.CardId == p.summary.inHand[0]) == null)
                {
                    lst.Add(p.summary.inHand[0]);
                }
                p.summary.inHand.RemoveAt(0);
            }

            foreach (int _value in lst)
            {
                ECard card = p.mCardHand.Find(c => c.CardId == -1);
                if (card != null)
                {
                    card.CardId = _value;
                }
            }

            p.mCardHand.Sort((c1, c2) => c1.CardId.CompareTo(c2.CardId));
        }
        game.UpdateHand();
        #endregion


        //0.5s cho Start Game mới. O.5s cho Gameplay Process Command Update Hand
        float time = game.TimeCountDown;

        float timeShowPoint = (time - 1) / 3f;
        float timeShowResult = timeShowPoint, timeShowMoney = timeShowPoint;

        MiniState = EGameStateMini.summary_point;
        GameModelChan.game.UpdateUI();
        yield return(new WaitForSeconds(timeShowPoint));

        #region PLAY SOUNDS


        #endregion

        MiniState = EGameStateMini.summary_result;
        GameModelChan.game.UpdateUI();
        yield return(new WaitForSeconds(timeShowResult));

        MiniState = EGameStateMini.summary_exchange;

        //GameModel.game.UpdateUserInfo();

        //GameModel.game.UpdateUI();
        //yield return new WaitForSeconds(timeShowMoney);

        MiniState = EGameStateMini.summary_end;
        GameModelChan.game.UpdateUI();
        yield return(new WaitForSeconds(0.5f));

        //DestroyObject();

        game.lbDiscard.text = "";

        ListResultXuongView.Close();
        game.fullLayingEffect.Destroy();

        GameModelChan.CreateNewGame();

        ListPlayerInGame.ForEach(p =>
        {
            p.warningMessage = "";
            p.Reset();
            p.summary.result = PlayerControllerChan.FinishGame.ResultSprite.None;
        });

        game.IsProcesResonseDone = true;
    }