public override void ShowChoiseView(ISFSObject cardData) { base.ShowChoiseView(cardData); InitPokerList(); //初始化左侧的牌 RepositionCards(); //将左侧的牌排列成三行 gameObject.SetActive(true); int[] array = cardData.GetIntArray("cards"); HelpLz help = new HelpLz(); List <int> pokerList = array.ToList(); Resort(pokerList); List <HelpLz.PlayerDuns> pd = help.getPlayerDuns(pokerList); while (pd.Count > 0 && pd[0].Duns[0] == null) { pd.Remove(pd[0]); } int itemCount = pd.Count > 3 ? 3 : pd.Count; //初始化数据 for (int i = 0; i < itemCount; i++) { ChoiseItem item = _choiseItems[i]; item.gameObject.SetActive(true); if ((int)pd[i].SpecialType - (int)CardType.none >= 0) //特殊牌型,不用显示每行牌型 { item.SpecialObj.SetActive(true); item.NormalObj.SetActive(false); item.Special = (int)pd[i].SpecialType; item.SpecialSprite.spriteName = pd[i].SpecialType.ToString(); item.SpecialSprite.MakePixelPerfect(); item.SetChoiseItem(pd[i].Duns); } else //普通牌型,要显示每组牌的牌型 { item.SpecialObj.SetActive(false); item.NormalObj.SetActive(true); item.SetChoiseItem(pd[i].Duns); } } OnClickPlane(_choiseItems[0]); }
public override void ShowChoiseView(ISFSObject cardData) { base.ShowChoiseView(cardData); InitPokerList(); gameObject.SetActive(true); int[] cardArray = cardData.GetIntArray("cards"); _cardValList = cardArray.ToList(); HelpLz.SortList(_cardValList); HelpLz help = new HelpLz(); List <HelpLz.PlayerDuns> pd = help.getPlayerDuns(_cardValList); //初始化手牌,待删 for (int i = 0; i < CardsList.Count; i++) { CardsList[i].SetCardId(_cardValList[i]); CardsList[i].SetCardFront(); } RespositionCards();//初始化手牌位置 if (SpecialBtn != null) { if (pd.Count > 0 && pd[0].SpecialType > CardType.none) { _specialDuns = pd[0]; SpecialBtn.gameObject.SetActive(true); } else { _specialDuns = null; SpecialBtn.gameObject.SetActive(false); } } SetChoiseView(_cardValList); }