Пример #1
0
    public void CreateQuestionCard(int num, Direction d)
    {
        GameObject qCard      = _qCardObjectPool.GetObject();
        SCard      cardScript = qCard.GetComponent <SCard>();

        cardScript.Init(num, d);
        _questionBox.CardInput(qCard, d);
        _questionCardList.Add(cardScript);
    }
Пример #2
0
    public void CreateAnswerCard(int num, Direction d, List <CardType> list)
    {
        if (_mustUseCardCount < 1)
        {
            return;
        }
        if (_constLeftRight)
        {
            if (_mustUseLeftCardCount == 0 && d == Direction.LEFT)
            {
                return;
            }
            if (_mustUseRightCardCount == 0 && d == Direction.RIGHT)
            {
                return;
            }
        }

        SoundMng.GetInstance.Play(0);
        _mustUseCardCount--;
        if (d == Direction.LEFT)
        {
            _mustUseLeftCardCount--;
        }
        else
        {
            _mustUseRightCardCount--;
        }

        GameObject aCard      = _aCardObjectPool.GetObject();
        SCard      cardScript = aCard.GetComponent <SCard>();

        cardScript.Init(num, d);
        _answerBox.CardInput(aCard, d);
        _answerBox.gameObject.GetComponent <Scales>().AddWeight(num, d);
        for (int i = 0; i < list.Count; i++)
        {
            cardScript.AddCardType(list[i]);
        }
    }