Why contain only check the last array from list? When I try type test1 result "not found". How try contains string from array list.
public class FindContainsText : MonoBehaviour
{
public Text text;
public InputField intext;
List<string> guess = new List<string>();
private string answer;
void Start()
{
guess.Add("test1");
guess.Add("test2");
answer="ok";
}
void Update()
{
foreach (string x in guess)
{
if (intext.text.ToLower().Contains(x.ToLower()))
{
text.text = answer;
}
else
{
text.text = "not found";
}
}
}
}