Question by
JackiChen · Sep 03, 2016 at 02:28 PM ·
inputinputfieldienumeratormethods
After pressing enter on an Inputfield, it doesn't do what it should
So basically what i'm trying to do is to wait for the UserInput in the Inputfield and then if the word matches the word in the WordsList, it should change the string Guess to a new Random word in the WordsList and print that out on the Textfield. But after typing in the same word,it doesn't change the word in WTP.text. I'm very new to programming,so i just can't find the problem.
IEnumerator LE()
{
ListBool = true;
while (ListBool == true)
{
for (int i = 6; i < 36; i += 2)
{
do
{
ListEasy2();
yield return 0;
DoBool = false;
} while (DoBool == true);
yield return new WaitUntil(() => InputFromUser == Guess);
for (int x = 0; x < i; x++)
{
while (RunWhileInEnum == true) {
yield return 0;
RandomZahl = Random.Range(0, 244);
Guess = WordsList[RandomZahl];
WTP.text = Guess;
WrongText.SetActive(false);
}
while(RunWhileInEnum == false)
{
yield return 0;
WrongText.SetActive(true);
WTP.text = Guess;
}
}
timer += 15.5f;
InputCorrect = false;
Level++;
LevelText.text = "Level:" + Level;
DoBool = true;
}
ListBool = false;
}
RunningLE = false;
}
public void GetInput1(string InputFromUser)
{
if (InputFromUser.Equals(Guess) == true)
{
InputCorrect = true;
RunWhileInEnum = true;
}
else
{
InputCorrect = false;
RunWhileInEnum = false;
}
UserInput.text = "";
Thx for your help.
Comment
Your answer
Follow this Question
Related Questions
I need help with input field ui. 0 Answers
Check if EventSystem is in InputField 1 Answer
Click two buttons at the same time 0 Answers
I want to activate a cursor after using MoveTextEnd 0 Answers
Input Field between scenes 0 Answers