示例#1
0
        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));
        }
示例#2
0
        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));
        }
示例#3
0
 public void PlayCard(CardPanel cardPanel)
 {
     TurnManager.Instance.PlayCard(cardPanel);
 }
示例#4
0
 public void RemoveCard(CardPanel cardPanel)
 {
     cardStock.Remove(cardPanel.Card);
 }