コード例 #1
0
        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();
            });
        }
コード例 #2
0
 public CardViewFactory(CardView cardViewPrefab, IReadOnlyList <Sprite> icons)
 {
     this.cardViewPrefab = cardViewPrefab;
     this.icons          = icons;
 }