public bool AddCard(CardInZhibo cardInfo) { IResLoader loader = GameMain.GetInstance().GetModule <ResLoader>(); GameObject cardGo = loader.Instantiate("Zhibo/Card"); if (cardGo == null) { return(false); } MiniCard card = cardGo.GetComponent <MiniCard>(); card.Init(cardInfo, this); card.transform.SetParent(transform, false); cards.Add(card); Adjust(); return(true); }
public bool AddTmpCard(CardInZhibo cardInfo) { IResLoader loader = GameMain.GetInstance().GetModule <ResLoader>(); GameObject cardGo = loader.Instantiate("Zhibo/Card", FixedContainer); if (cardGo == null) { return(false); } MiniCard card = cardGo.GetComponent <MiniCard>(); card.Init(cardInfo, this); card.rt.anchoredPosition = Vector3.zero; card.rt.localEulerAngles = Vector3.zero; TmpCards.Add(card); AdjustTmp(); return(true); }