// TODO this still doesn't display correctly public void ShowDeck(Deck <BoostCard> deck) { if (!deck.IsEmpty) { if (_lastCard != deck.TopItem && _lastCount == deck.Count) { if (_interactable) { _mainButton.interactable = false; } _animView.transform.SetAsLastSibling(); _animView.Display(deck.GetCard(0)); _animView.gameObject.SetActive(true); RectTransform rect = _boostCardPrefab.GetComponent <RectTransform>(); Vector3 newPos = new Vector3(rect.transform.position.x, rect.transform.position.y + rect.rect.height, 0); LeanTween.move(_animView.gameObject, newPos, AnimationTime / 2).setOnComplete(FinishFlipAnimation); _mainView.Display(deck.TopItem); } // only when a card is removed from the deck else if (_lastCard != deck.TopItem && _lastCount > deck.Count) { _animView.transform.SetAsFirstSibling(); _animView.gameObject.SetActive(true); _animView.Display(deck.TopItem); Vector2 scale = _boostCardPrefab.transform.localScale; LeanTween.scale(_boostCardPrefab.gameObject, Vector2.zero, AnimationTime).setOnComplete( () => { FinishVanishAnimation(deck.TopItem, scale); }); } else if (_lastCard == deck.TopItem) { _mainView.Display(deck.TopItem); } _boostCardPrefab.gameObject.SetActive(true); _lastCard = deck.TopItem; _lastCount = deck.Count; } else { _boostCardPrefab.gameObject.SetActive(false); } _boostCountText.text = deck.Count.ToString(); }
private void ShowBoostCard(Deck <BoostCard> deck) { if (!deck.IsEmpty) { _view.Display(deck.TopItem); } else { gameObject.SetActive(false); } _countText.text = _controller.BoostDeck.Count.ToString(); }