コード例 #1
0
        private IEnumerator SpecialMove(CardPanel newPanel, CardPanel oldPanel)
        {
            if (_countDictionary.ContainsKey(oldPanel.Details.Player) && _countDictionary[oldPanel.Details.Player] > maxMoves)
            {
                Debug.LogWarning("Max moves reached");
                SetCompleted(false);
                yield break;
            }

            specialPanel.SetActive(true);

            oldCardPanel.gameObject.SetActive(false);
            newCardPanel.gameObject.SetActive(false);
            actionsPanel.gameObject.SetActive(false);

            oldCardPanel.SetCard(oldPanel.Card);
            newCardPanel.SetCard(newPanel.Card);
            StartCoroutine(Utils.Scale(oldCardPanel.transform, animationDuration, animationCurve,
                                       Vector3.one * startScale, Vector3.one));
            yield return(null);

            oldCardPanel.gameObject.SetActive(true);

            yield return(new WaitForSeconds(.2f));

            StartCoroutine(Utils.Scale(newCardPanel.transform, animationDuration, animationCurve,
                                       Vector3.one * startScale, Vector3.one));
            yield return(null);

            newCardPanel.gameObject.SetActive(true);

            yield return(new WaitForSeconds(.2f));

            StartCoroutine(Utils.Scale(actionsPanel.transform, animationDuration, animationCurve,
                                       Vector3.one * startScale, Vector3.one));
            yield return(null);

            actionsPanel.gameObject.SetActive(true);

            yield return(new WaitWhile(() => _isWaiting && !_isHerraf));

            if (_isHerraf)
            {
                yield return(quizManager.StartQuiz(newPanel.Card, SetCompleted));
            }
            if (_isCompleted)
            {
                if (!_countDictionary.ContainsKey(oldPanel.Details.Player))
                {
                    _countDictionary.Add(oldPanel.Details.Player, 0);
                }
                _countDictionary[oldPanel.Details.Player]++;
            }

            specialPanel.SetActive(false);
        }
コード例 #2
0
ファイル: CardManager.cs プロジェクト: zouhssain/herraf
 public void ShowPopup(CardPanel cardPanel)
 {
     if (cardPanel == null)
     {
         return;
     }
     previewButton.SetActive(cardPanel.Root.parent != cardGroup);
     if (previewButton.activeSelf)
     {
         previewButton.SetActive(TurnManager.Instance.IsPlayerTurn(cardPanel.Details.Player));
     }
     previewPopup.SetActive(true);
     previewCard.SetCard(cardPanel.Card);
     _previewCardPanel = cardPanel;
     StartCoroutine(Utils.Scale(previewCard.transform, animationDuration, animationCurve,
                                Vector3.one * previewScale, Vector3.one));
     if (previewButton.activeSelf)
     {
         StartCoroutine(Utils.Scale(previewButton.transform, animationDuration,
                                    animationCurve, Vector3.one * previewScale, Vector3.one));
     }
 }