public void Submission() { GameObject gen = GameObject.Find("IntegerGenerator"); ResoureIntegerLoop resourceInts = gen.GetComponent <ResoureIntegerLoop>(); if (mainInputField.text == resourceInts.answer.ToString()) { Debug.Log("correct"); resourceInts.Generate(); mainInputField.text = ""; scoreCounter += 10; } else { scoreCounter -= 5; } //TouchScreenKeyboard.Open("", TouchScreenKeyboardType.NumberPad, false, false, false, false, "Answer", 4); }
// Update is called once per frame void Update() { if (SceneManager.GetActiveScene().buildIndex == 1) { GameObject input = GameObject.Find("InputField"); EasyInput inputs = input.GetComponent <EasyInput>(); GameObject gen = GameObject.Find("IntegerGenerator"); ResoureIntegerLoop resourceInts = gen.GetComponent <ResoureIntegerLoop>(); time -= Time.deltaTime; var timerFormatted = string.Format("{0:0}:{1:00}", Mathf.Floor(time / 60), time % 60); timer.text = "Time: " + timerFormatted; score.text = "Score: " + inputs.scoreCounter; scoreFinal = inputs.scoreCounter; if (time <= 0) { Debug.Log("timeout"); timeOut(); } } }