public void ClearTodoCards() { foreach (var todo in _listTodoCards) { OnCardDestroyed?.Invoke(todo); Destroy(todo.gameObject); } _listTodoCards.Clear(); }
public void ClearActionCards() { foreach (var card in _listActionCards) { OnCardDestroyed?.Invoke(card); Destroy(card.gameObject); } _listActionCards.Clear(); }
public void Destroy() { CanBeDestroyed = true; foreach (IAbility ability in Abilities.FindAll(o => o.Trigger == EffectTrigger.CardDestroyed)) { ability.Process(new AbilityArgs() { OriginCard = this }); } if (CanBeDestroyed) { OnCardDestroyed?.Invoke(this, new CardEventArgs() { Card = this }); } }
public void DeleteCard(ActionCardData data) { CardController toRemove = null; foreach (var card in _listActionCards) { if (card.name == data.name) { toRemove = card; } } Debug.Log($"To remove : {toRemove}"); if (!toRemove) { return; } OnCardDestroyed?.Invoke(toRemove); _listActionCards.Remove(toRemove); Destroy(toRemove.gameObject); }