private void CheckDeadAndRemove(bool isDead, Card card) { if (!isDead) { return; } subscriptions[card].Dispose(); subscriptions.Remove(card); CardView cardView = cardViews[card]; cardViews.Remove(card); UniTask.Delay(TimeSpan.FromSeconds(cardDestructionDelaySec), DelayType.DeltaTime, cancellationToken: removalCancellation.Token) .ContinueWith(() => { cardView.ClearModel(); Destroy(cardView.gameObject); RepositionCards(); }); }
public CardViewFactory(CardView cardViewPrefab, IReadOnlyList <Sprite> icons) { this.cardViewPrefab = cardViewPrefab; this.icons = icons; }