/// <summary> /// 翻牌 /// </summary> /// <param name="cards"></param> public void TurnCards(List <string> cards) { showCard = true; if (cards.Count == 5) { mHandCard = cards; } List <Transform> list = mHandCardGid.GetChildList(); for (int i = 0; i < list.Count; i++) { NiuniuHandCard handCard = list[i].GetComponent <NiuniuHandCard>(); if (handCard != null) { handCard.SetCard(cards[i]); if (mHandCardGid.cellWidth > 0) { handCard.SetCardDeepsByIndex(i); } else { handCard.SetCardDeepsByIndex(list.Count - i); } handCard.TurnCard(0.3f, true); } } }
/// <summary> /// 直接添加一张手牌 /// </summary> /// <param name="value"></param> /// <param name="show"></param> private void DirectAddOneHandCard(int seatId, int index, string value, bool show = false) { GameObject obj = obj = NGUITools.AddChild(mHandCardGid.gameObject, mHandCardItem); NiuniuHandCard card = obj.GetComponent <NiuniuHandCard>(); obj.gameObject.SetActive(true); if (seatId == NiuniuModel.Inst.mMySeatId) { obj.transform.localScale = new Vector3(2f, 2f, 2f); } if (value != "0" && !string.IsNullOrEmpty(value)) { card.SetCard(value); } if (show) { card.ShowCardNum(value); } else { card.ShowCardBg(); } mHandCard.Add(value); mHandCardGid.Reposition(); }