Hello,
So I need function which on run first put into the text field “Day 1” and then waits for user to read it and then on click it changes for “Day 2”
Whole code work just fine but StartCoroutine(WaitforClick()); is being completly ignored, So on run it is skipped and I have right away in my text box “Day 2”
Is there any simple way to create function that would wait until mouse button is clicked?
public void newDay(){
bool dayOne = true;
bool dayTwo = true;
if (dayOne == true) {
dayInfo.text ="Day1";
}
StartCoroutine(WaitforClick());
if(dayTwo == true{
dayInfo.text = "Day 2";
}
}
IEnumerator WaitforClick(){
while(true)
{
if(Input.GetMouseButtonDown(0))
{
yield break;
}
yield return null;
}
}