/// <summary> /// 显示卡组 /// </summary> /// <param name="cardGroup"></param> private void Show(Group cardGroup) { for (int i = 0; i < cardGroup.GroupNum; i++) { Card_Select card_select = cardList[i]; Card card = cardGroup.GetCard(i); card_select.SetActive(true); card_select.SetText(card.curArea, card.areaRank); card_select.SetTexture(card.cardID, false); } for (int i = cardGroup.GroupNum; i < 10; i++) { Card_Select card_select = cardList[i]; card_select.SetActive(false); } for (int i = (curPage - 1) * 10; i < curPage * 10; i++) { if (i >= choseList.Count) { break; } if (choseList[i]) { cardList[i % 10].SetSelect(); } else { cardList[i % 10].SetDisSelect(); } } UpdateText(); }
private void InitCardGroup() { curShowGroup = new Group(); for (int i = 0; i < 10; i++) { GameObject card = GameObject.Instantiate(cardPrefeb); card.transform.SetParent(layoutGroup.transform); card.transform.localScale = Vector3.one; card.GetComponent <RectTransform>().anchoredPosition3D = Vector3.zero; Card_Select card_select = card.GetComponent <Card_Select>(); card_select.Init(i); cardList.Add(card_select); card_select.SetActive(false); card_select.event_disSelectCard += card_select_event_disSelectCard; card_select.event_selectCard += card_select_event_selectCard; } }