public IEnumerator TurnCard(CardPanel cardPanel) { var card = cardPanel.transform; yield return(Utils.Rotate(card, animationDuration, animationCurve, card.localEulerAngles, card.localEulerAngles + Vector3.up * 90)); cardPanel.SetRevealed(!cardPanel.IsRevealed); yield return(Utils.Rotate(card, animationDuration, animationCurve, card.localEulerAngles, card.localEulerAngles + Vector3.up * 90)); }
public IEnumerator DistributeCard(CardPanel cardPanel, Transform transform) { var card = cardPanel.transform; var position = card.transform.position; cardPanel.Root.SetParent(transform); if (!cardPanel.IsRevealed) { StartCoroutine(TurnCard(cardPanel)); } cardPanel.gameObject.SetActive(false); yield return(null); cardPanel.gameObject.SetActive(true); card.localPosition = card.InverseTransformPoint(position); yield return(Utils.Translate(card, animationDuration, animationCurve, card.localPosition, Vector3.zero)); }
public void PlayCard(CardPanel cardPanel) { TurnManager.Instance.PlayCard(cardPanel); }
public void RemoveCard(CardPanel cardPanel) { cardStock.Remove(cardPanel.Card); }