private void ResetHandId() { for (int i = 0; i < cards.Count; i++) { MainPlayerCard mainPlayerCard = cards[i]; mainPlayerCard.card.handId = i; } }
public override void AddCard(Card card) { GameObject go = Instantiate(ResourceManager.GetMainPlayerCardPrefab()); go.transform.SetParent(cardsTransform); MainPlayerCard mainPlayerCard = go.GetComponent <MainPlayerCard>(); mainPlayerCard.card = card; mainPlayerCard.card.handId = cards.Count; cards.Add(mainPlayerCard); }
public int[] GetSelectedCardsId() { List <int> result = new List <int>(); for (int i = 0; i < cards.Count; i++) { MainPlayerCard card = cards[i]; if (card.selected) { result.Add(i); } } return(result.ToArray()); }