Beispiel #1
0
 internal void SetDeclareDetail(DeclarResponse result)
 {
     PlayerPanelReset();
     OnDisable();
     _userId           = result.userId;
     userName.text     = result.userName;
     currentScore.text = result.points.ToString();
     totalScore.text   = result.totalPoints.ToString();
     wonGameObject.SetActive(result.isWinner);
     positionImage.gameObject.SetActive(false);
     for (int i = 0; i < result.cardGroup.Count; i++)
     {
         //if (result.droped)
         //{
         //   dropGameobject.SetActive(true);
         //    continue;
         //}
         groupObject[i].SetActive(true);
         for (int j = 0; j < result.cardGroup[i].card_set.Count; j++)
         {
             var gObject = Instantiate(cardGameObject);
             gObject.transform.SetParent(groupObject[i].transform);
             gObject.GetComponent <UICard>().SetDetail(result.cardGroup[i].card_set[j].cardValue,
                                                       result.cardGroup[i].card_set[j].suitValue);
             cardObects.Add(gObject);
         }
     }
 }
        public void OnDeclareComplete(DeclarResponse result)
        {
            _isEliminated = false;
            foreach (var resultPanel in resultPanels)
            {
                if (resultPanel.GetUserId == result.userId)
                {
                    resultPanel.UpdateState(true);
                    resultPanel.PlayerPanelReset();
                    resultPanel.SetDeclareDetail(result);
                }
            }

            UpdatePlayerPosition(result.gameResult);
            //if (result.isLastRound)
            //{
            //    //CancelInvoke(nameof(UpdateNextTimer));
            //    OnPlayerRemove();
            //}
        }
 private void OnDeclarePlayer(DeclarResponse response)
 {
     playerTurn    = response.playerTurn;
     remainingTime = response.remainingTime;
     UiManager.GetInstance.StartTimer(playerTurn, remainingTime, OnTimerComplete);
     GameplayController.GetInstance.SetShowCard(response.showCard);
     CardGroupController.GetInstance.EnableDropButton(true);
     if (_isPlayerDeclare)
     {
         if (int.Parse(GameVariables.userId) != response.userId)
         {
             UiManager.GetInstance.SetDeclareScreeenData(response);
         }
         ResultScreen.GetInstance?.UpdateNextMatchTimer(response.nextRoundStartTime);
         ResultScreen.GetInstance?.UpdatePlayerPosition(response.gameResult);
         return;
     }
     if (int.Parse(GameVariables.userId) == playerTurn)
     {
         _isOtherplayerDeclared = true;
         UiManager.GetInstance.ConfirmationPoup("Are you sure you want to Declare?", "Declare", Declare);
         CardGroupController.GetInstance.UpdateDeclareButtonState(true);
     }
 }
Beispiel #4
0
 internal void SetDeclaredata(DeclarResponse result)
 {
     resultScreen.OnDeclareComplete(result);
 }
 public void OnPlayerDeclare(DeclarResponse declarResponse)
 {
 }
Beispiel #6
0
 internal void SetDeclareScreeenData(DeclarResponse result)
 {
     gameplayController.SetDeclaredata(result);
 }