Esempio n. 1
0
    public void Confirm(bool isConfirm)
    {
        if (signalInvokeConfirm)
        {
            signalInvokeConfirm.Invoke(isConfirm);
        }

        Close();
    }
Esempio n. 2
0
    void OnInputSubmit()
    {
        //fail-safe, shouldn't be able to submit
        if (mOperation == null || mOperation.isAnyOperandEmpty || isBusy)
        {
            return;
        }

        var opAnswer = mOperation.Evaluate();

        //NOTE: assume we can only input positives
        opAnswer.isNegative = false;

        bool isCorrect = answerInput.number.isValid && answerInput.number == opAnswer;

        if (isCorrect)
        {
            answerInput.CloseNumpad();

            M8.SoundPlaylist.instance.Play(audioCorrect, false);
        }
        else
        {
            M8.SoundPlaylist.instance.Play(audioWrong, false);

            if (animator && !string.IsNullOrEmpty(takeWrong))
            {
                animator.Play(takeWrong);
            }
        }

        //end drag instruction
        if (isCorrect)
        {
            DragInstructEnd();
        }

        signalAnswer.Invoke(isCorrect);
    }
Esempio n. 3
0
 public void Invoke()
 {
     signal.Invoke(invokeValue);
 }