How can I do this more efficiently, so I don’t have to rewrite for every different word. What is the best way to check against an array of strings? An example would be great, thanks!
if (logtxt.Contains(“hello”))
{
StartCoroutine(PostScores(“hello”, “test”));
File.WriteAllText(UnityEngine.Application.dataPath + “/log/log.txt”, “”);
}
if (logtxt.Contains(“bye”))
{
StartCoroutine(PostScores(“bye”, “test”));
File.WriteAllText(UnityEngine.Application.dataPath + “/log/log.txt”, “”);
}