Пример #1
0
    public void ScoreLevelUpdate(int pScore)
    {
        if (pScore == 0 ||
            pScore >= scoreLevelNext)
        {
            float addTimeNew = dataCtrl.getAddTime(pScore);
            _gameManager.setAddTimePerBlock(addTimeNew);

            scoreLevelNow  = scoreLevelNext;
            scoreLevelNext = dataCtrl.getNextTargetScore(pScore);
        }
    }
Пример #2
0
    void answer(int pInputAnswer)
    {
        if (state != GameState.PLAYING ||
            _inputManager.disabled)
        {
            return;
        }
        string answer = "";

        if (_questionCtrl.getAnswer() < 0)
        {
            answer = "ERROR!!";
            DebugLogger.Log(answer);
            return;
        }
        DebugLogger.Log("getAnswer:" + _questionCtrl.getAnswer() + " myAnswer:" + pInputAnswer);

        if (_questionCtrl.getAnswer() == pInputAnswer)
        {
            _audioManager.play(Const.SE_CORRECT_CHIME);

            answer = Const.LBL_CORRECT;
            addScore(ADD_SCORE);

            addTime(_dataCtrl.getAddTime(score));
            setLabelAnswer(answer);
            UpdateImage();
        }
        else
        {
            _audioManager.play(Const.SE_WRONG_CHIME);

            answer = Const.LBL_WRONG;
            wrongAnswer(_questionCtrl.getAnswer());

            // 色を変更
            ColorEditor.setColorFromColorCode(_labelAnswer.gameObject, Const.COL_NEGATIVE);
            setLabelAnswer(answer, false);
        }
        DebugLogger.Log(answer);
    }