I have a program which is searching words in a big sized word list In a game engine uses C# . But my problem is that when the list of words too big UI look seems it was hang. In prevention of it, I use UI so the user will know how many words searching. But the problem is that the UI shows result when searching is already done. How will I let the UI start give info when the user click certain button? Thank you in advance.
public int searchedTextAmount = 0;
void Start()
{
int seacrhedTextAmount = 0;
}
void Update()
{
ui.text = searchedTextAmount; // when buttonclickevent started, I like this value change while searching process in progress supplied by Search_Method
}
void Search_Method()
{
foreach (string word in words)
{
searchedTextAmount++;
//someoperations
}
}
void butonclickevent()
{
Invoke("Search_Method");
}