Exemplo n.º 1
0
    public void UICheckAnswer()
    {
        if (inputField.text != "")
        {
            string s = inputField.text;
            int    i = 0;
            while (s.Length > i && s[i] == '0')
            {
                i += 1;
            }
            s = s.Remove(0, i);
            if (AnswerText == s)
            {
                s = s + "(" + NumberSystemManager.NumberSystemToInt(AnswerNumberSystem) + ")";

                inputField.interactable = false;
                button.interactable     = false;
                nothingText.enabled     = false;
                wrongText.enabled       = false;
                rightText.enabled       = true;

                isRight = true;
                if (isWrong)
                {
                    expirienceText.text = "Опыт получен +" + (int)(7.5f * difficultyKoef) + " (допущена ошибка)";
                }
                else
                {
                    expirienceText.text = "Опыт получен +" + (int)(10 * difficultyKoef);
                }
                EducationStatistics.statistics.Experience += (int)(10 * difficultyKoef);

                EducationStatistics.statistics.ThemeTasksDatas[(int)theoryTheme].CorrectAnswers += 1;

                EducationStatistics.SaveStatistics();
            }
            else
            {
                if (!isWrong)
                {
                    if (EducationStatistics.statistics.Experience - (int)(2.5f * difficultyKoef) > 0)
                    {
                        expirienceText.text = "Опыт потерян -" + (int)(2.5f * difficultyKoef);
                        EducationStatistics.statistics.Experience -= (int)(2.5f * difficultyKoef);
                    }
                    else
                    {
                        expirienceText.text = "Опыт не потерян";
                    }
                    EducationStatistics.statistics.ThemeTasksDatas[(int)theoryTheme].WrongAnswers += 1;
                    EducationStatistics.SaveStatistics();
                    isWrong = true;
                }
                nothingText.enabled = false;
                wrongText.enabled   = true;
            }
            inputField.text = s;
        }
    }
Exemplo n.º 2
0
 internal void CheckRight()
 {
     foreach (Equation Eq in Equations)
     {
         if (Eq.isRight == false && Eq.isWrong == false)
         {
             EducationStatistics.statistics.ThemeTasksDatas[(int)Eq.theoryTheme].WrongAnswers += 1;
         }
     }
     EducationStatistics.SaveStatistics();
 }
Exemplo n.º 3
0
 public static void Initialize()
 {
     if (!isCreated)
     {
         isCreated = true;
         Saves.Initialise();
         EducationStatistics.Initialise();
         SceneController.Initialise();
         GameObject G = Instantiate(Resources.Load <GameObject>(GameManagerPath));
         DontDestroyOnLoad(G);
     }
 }