public void ShowNewEvent(EventDecisionData thisEvent) { CardOption thisCard = cardsList.Find(x => x.thisCardType == thisEvent.eventType); if (thisCard != null) { thisCard.gameObject.SetActive(true); thisCard.InitializeText(thisEvent.title, thisEvent.description); currentCard = thisCard; currentCard.ShowCardAnim(); } }
IEnumerator HideAnimCard(CardOption thisCard, Action callback = null) { thisCard.myPanel.PlayCloseAnimation(); yield return(new WaitForSeconds(thisCard.myPanel.myAnim.GetClip(thisCard.myPanel.closeAnimationName).length)); currentCard.gameObject.SetActive(false); currentCard = null; if (callback != null) { callback(); } RemoveCurrentEvent(); }