protected virtual void OnTriggerExit2D(Collider2D collision) { IContainCards collidedContainer = collision.gameObject.GetComponent <IContainCards>(); if (collidedContainer != null) { OnTriggerExitOccur?.Invoke(collidedContainer, _reference); } }
public void AddReceiver(IContainCards receiver, CardController card) { Transfer transfer = Transfers.Find((t) => t.card.Equals(card)); if (transfer.sender != transfer.receiver) { transfer.receiver = receiver; } }
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)); }
public void RemoveReceiver(IContainCards receiver, CardController card) { Transfer transfer = Transfers.Find((t) => t.card.Equals(card)); transfer.receiver = null; }
public Transfer(IContainCards sender, CardController card) { this.sender = sender; this.card = card; receiver = null; }
public void InstantTransfer(IContainCards sender, CardController card, IContainCards receiver) { sender.RemoveCard(card); receiver.AddCard(card); }