コード例 #1
0
 public void ClearTodoCards()
 {
     foreach (var todo in _listTodoCards)
     {
         OnCardDestroyed?.Invoke(todo);
         Destroy(todo.gameObject);
     }
     _listTodoCards.Clear();
 }
コード例 #2
0
 public void ClearActionCards()
 {
     foreach (var card in _listActionCards)
     {
         OnCardDestroyed?.Invoke(card);
         Destroy(card.gameObject);
     }
     _listActionCards.Clear();
 }
コード例 #3
0
        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
                });
            }
        }
コード例 #4
0
    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);
    }