Question by
bengrayawhile · Nov 12, 2016 at 09:27 AM ·
scripting probleminputtextloop
How do I wait for input in a for loop.
How can i wait for input from a text input field inside of a for loop? My current code loops through completely without waiting for any input.
public Charachter[] party = new Charachter[4];
public void PartySetupEvent()
{
for (i = 0; i < party.Length; i++)
{
PartyNameGet();
PartyClassGet();
}
}
public void PartyNameGet()
{
textInputField.onEndEdit.AddListener(NameApply);
}
public void NameApply(string name)
{
party[i].Name = name;
}
public void PartyClassGet(Event passEvent)
{
textInputField.onEndEdit.AddListener(ClassApply);
}
public void ClassApply(string className)
{
party[i].Class = className;
}
Comment
Your answer
Follow this Question
Related Questions
Can't think of a way to do this... 0 Answers
Unity freezes. I dont know why... 3 Answers
How to stop infinite loop in Unity? 1 Answer
Custom input not appearing in input manager 0 Answers
Input Field Problem 0 Answers