Example #1
0
    protected virtual void OnTriggerExit2D(Collider2D collision)
    {
        IContainCards collidedContainer = collision.gameObject.GetComponent <IContainCards>();

        if (collidedContainer != null)
        {
            OnTriggerExitOccur?.Invoke(collidedContainer, _reference);
        }
    }
Example #2
0
    public void AddReceiver(IContainCards receiver, CardController card)
    {
        Transfer transfer = Transfers.Find((t) => t.card.Equals(card));

        if (transfer.sender != transfer.receiver)
        {
            transfer.receiver = receiver;
        }
    }
Example #3
0
    public void OpenTransfer(IContainCards sender, CardController card)
    {
        sender.RemoveCard(card);

        card.Interaction.OnMouseUpOccur    += CloseTransfer;
        card.Collision.OnTriggerEnterOccur += AddReceiver;
        card.Collision.OnTriggerExitOccur  += RemoveReceiver;

        Transfers.Add(new Transfer(sender, card));
    }
Example #4
0
    public void RemoveReceiver(IContainCards receiver, CardController card)
    {
        Transfer transfer = Transfers.Find((t) => t.card.Equals(card));

        transfer.receiver = null;
    }
Example #5
0
 public Transfer(IContainCards sender, CardController card)
 {
     this.sender = sender;
     this.card   = card;
     receiver    = null;
 }
Example #6
0
 public void InstantTransfer(IContainCards sender, CardController card, IContainCards receiver)
 {
     sender.RemoveCard(card);
     receiver.AddCard(card);
 }