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

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

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