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

        if (collidedContainer != null)
        {
            OnTriggerExitOccur?.Invoke(collidedContainer, _reference);
        }
    }
Ejemplo n.º 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;
        }
    }
Ejemplo n.º 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));
    }
Ejemplo n.º 4
0
    public void RemoveReceiver(IContainCards receiver, CardController card)
    {
        Transfer transfer = Transfers.Find((t) => t.card.Equals(card));

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