private void InitCardGroup() { curShowList = new List <string>(); for (int i = 0; i < 7; i++) { GameObject card = GameObject.Instantiate(cardPrefeb); card.transform.SetParent(layoutGroup.transform); card.transform.localScale = Vector3.one; card.GetComponent <RectTransform>().anchoredPosition3D = Vector3.zero; Card_SearchResult card_select = card.GetComponent <Card_SearchResult>(); card_select.Init(); cardList.Add(card_select); card_select.SetActive(false); } }
/// <summary> /// 显示卡组 /// </summary> /// <param name="cardList"></param> private void Show(List <string> list) { for (int i = 0; i < list.Count; i++) { Card_SearchResult card_select = cardList[i]; string str = list[i]; card_select.SetActive(true); card_select.SetTexture(str, false); card_select.SetText(str); } for (int i = list.Count; i < 7; i++) { Card_SearchResult card_select = cardList[i]; card_select.SetActive(false); } }