I hve that script:
public void ActivateCard(Card card)
{
Debug.Log("Activating card: " + card.CardsData);
if (card.CardsData.creatureName != string.Empty)
Summon(card);
else
CastSpell(card);
if (_hand.Cards.Contains(card))
{
_hand.Cards.Remove(card);
Debug.Log("Card " + card.CardsData.cardName + " deleted");
Debug.Log("now we have(cards): " + _hand.Cards.Count);
}
_hand.TakingCards(0);
}
And I expect that card will be removed from the list. But it allways remove only FIRST element in there. Here's what I have(card can't be the same in one list):
ADDICTION:
It's not a full code, but it's all we need I think. Here's how this method calls: -I-
public class InputClass
{
void Update
{
if (targetSet)
{
if (Input.touches[0].phase == TouchPhase.Ended)
Cancel(true);
}
}
void Cancel(bool isDone){ _actCard.Cancel(isDone); }
}
-II-
class ActCard
{
public void Cancel(bool isDone)
{
if (isDone)
{
_activator.ActivateCard(_card);
}
}
}
-III-
class CardActivator
{
public void ActivateCard(Card card)
{
Debug.Log("Activating card: " + card.CardsData);
if (card.CardsData.creatureName != string.Empty)
Summon(card);
else
CastSpell(card);
if (_hand.Cards.Contains(card))
{
_hand.Cards.Remove(card);
Debug.Log("Card " + card.CardsData.cardName + " deleted");
Debug.Log("now we have(cards): " + _hand.Cards.Count);
}
}
}
-IV-
public class Hand
{
List<Card> _hand = new List<Card>();
public List<Card> Cards
{
get { return _hand; }
set { _hand = value; }
}
}
```
card.CardsData.cardsName
it doesn't counts, right? \$\endgroup\$