예제 #1
0
    public void CheckSolution()
    {
        if (!_isActive)
        {
            return;
        }

        ResetRecall();

        int value = _screen.CalculateCurrentValue();

        if (_screen.launchValid && value == Session.instance.currentLevel.value)
        {
            _screen.queue.EndlessExit(true, true);

            EndRecall();

            _screen.tutorial.Show("showHintGo", true, _screen.hud.launchBtn.position, _screen.hud.launchBtn);
            _screen.expression.ResetHintingFades(); // reset hinting fades
            _currentFocus = null;

            //_screen.input.EnableAllInput(true);
            _screen.input.EnableAllInput(false, GameplayInput.SUBMIT, GameplayInput.SUBMIT_NUMPAD, GameplayInput.TOGGLE_NUMBER_PAD, GameplayInput.NUMBER_PAD_ARROWS);
            _screen.input.EnableCountingAndPause(true);
            _screen.queue.EndlessExit(true, true);

            _ones.ClearHints();
            _tens.ClearHints();

            SetActive(false);
        }
    }
예제 #2
0
    private void StartCounting()
    {
        if (!_isActive)
        {
            return;
        }


        CheckSolution();

        if (!_isActive)
        {
            return;
        }

        if (Session.instance.currentLevel.isSubtractionProblem)
        {
            _isBorrowing = CheckBorrowing();
            if (!_isBorrowing)
            {
                _ones.StartHintCounting(_screen.EnableOnesDragOut);
                _currentFocus = _ones;
                _screen.expression.GetComponent <Animator>().SetBool("hintFadeTens", true);
                _screen.tutorial.HideAll();
                _tens.ClearHints();
            }
        }
        else if (Session.instance.currentLevel.isAdditionProblem)
        {
            _isBorrowing = false;
            if (CheckCarryover(_screen.onesColumn, true))
            {
                return;
            }
            bool bIsCarryover = Session.instance.currentLevel.isTargetNumber ? _ones.targetNumCreatures == 10 : _ones.targetNumCreatures == _ones.numCreatures + 10;
            if (bIsCarryover && Session.instance.currentLevel.requiresMultipleCarryover)
            {
                if (Session.instance.currentLevel.isTargetNumber)
                {
                    StartMultipleCarryover();
                    return;
                }
                _ones.targetNumCreatures = _ones.numCreatures;
            }

            _ones.StartHintCounting(_screen.EnableOnesDragIn);
            _currentFocus = _ones;
            _screen.expression.GetComponent <Animator>().SetBool("hintFadeTens", true);
            _tens.ClearHints();
            _screen.tutorial.HideAll();
        }
    }