コード例 #1
0
ファイル: CardManager.cs プロジェクト: zouhssain/herraf
        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
ファイル: CardManager.cs プロジェクト: zouhssain/herraf
        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);
 }