/// <summary> /// 桌面清空 /// </summary> /// <param name="pos"></param> public void Clear(ShowPoint pos) { switch (pos) { case ShowPoint.Desk: Cards.Clear(); CardUI[] cardUIs = CreatePoint.GetComponentsInChildren <CardUI>(); for (int i = 0; i < cardUIs.Length; i++) { cardUIs[i].Destroy(); } break; case ShowPoint.Player: PlayerCardList.Clear(); CardUI[] cardUIPlayer = PlayerPoint.GetComponentsInChildren <CardUI>(); for (int i = 0; i < cardUIPlayer.Length; i++) { cardUIPlayer[i].Destroy(); } break; case ShowPoint.ComputerRight: ComputerRightCardList.Clear(); CardUI[] cardUIRight = ComputerRightPoint.GetComponentsInChildren <CardUI>(); for (int i = 0; i < cardUIRight.Length; i++) { cardUIRight[i].Destroy(); } break; case ShowPoint.ComputerLeft: ComputerLeftCardList.Clear(); CardUI[] cardUILeft = ComputerLeftPoint.GetComponentsInChildren <CardUI>(); for (int i = 0; i < cardUILeft.Length; i++) { cardUILeft[i].Destroy(); } break; default: break; } }
public virtual void AddCard(Card card, bool selected, ShowPoint pos) { switch (pos) { case ShowPoint.Desk: Cards.Add(card); //***// card.BelongTo = characterType; CreateCardUI(card, Cards.Count - 1, selected, pos); break; case ShowPoint.Player: PlayerCardList.Add(card); //***// card.BelongTo = characterType; CreateCardUI(card, PlayerCardList.Count - 1, selected, pos); break; case ShowPoint.ComputerRight: ComputerRightCardList.Add(card); //***// card.BelongTo = characterType; CreateCardUI(card, ComputerRightCardList.Count - 1, selected, pos); break; case ShowPoint.ComputerLeft: ComputerLeftCardList.Add(card); //***// card.BelongTo = characterType; CreateCardUI(card, ComputerLeftCardList.Count - 1, selected, pos); break; default: break; } }