Ejemplo n.º 1
0
        protected IEnumerator ShowCard()
        {
            var wait = new WaitForSeconds(ShowCardWaitTime);

            for (int i = 0; i < 4; i++)
            {
                var value = CardsValue.GetSFSObject(i).GetIntArray(Parameter.Cards);
                var go    = Cards[CardsArrindex];
                var mj    = go.GetComponent <MjCard>();
                mj.CardValue = value[ShowIndex];
                mj.TurnCard();
                CardsArrindex += 2;
                CardsArrindex  = CardsArrindex >= 8 ? CardsArrindex % 8 : CardsArrindex;
                yield return(new WaitForSeconds(ShowPointWaitTime));

                if (HistoryCards.ContainsKey(value[ShowIndex]))
                {
                    HistoryCards[value[ShowIndex]]++;
                    ShowNum    = value[ShowIndex] - 1;
                    ShowTarget = HistoryCards[value[ShowIndex]];
                    HistoryCardsCtrl.RefrshDataOnPlay(ShowNum, ShowTarget);
                }
                ShowPoints(i);
                yield return(wait);
            }
        }
Ejemplo n.º 2
0
 protected void ShowMingCards(bool isFrist = false)
 {
     for (int i = 0; i < 4; i++)
     {
         var value = MingCardsValue.GetSFSObject(i).GetIntArray(Parameter.Cards);
         var go    = Cards[CardsArrindex];
         var mj    = go.GetComponent <MjCard>();
         mj.CardValue = value[ShowMingIndex];
         mj.TurnCard(isFrist);
         CardsArrindex += 2;
         CardsArrindex  = CardsArrindex >= 8 ? CardsArrindex % 8 : CardsArrindex;
         if (HistoryCards.ContainsKey(value[ShowMingIndex]))
         {
             HistoryCards[value[ShowMingIndex]]++;
             ShowNum    = value[ShowMingIndex] - 1;
             ShowTarget = HistoryCards[value[ShowMingIndex]];
             HistoryCardsCtrl.RefrshDataOnPlay(ShowNum, ShowTarget);
         }
     }
 }