I was just looking at a project’s code and saw that it uses a coroutine for checking for input.
Is there a functional difference between the following?
private IEnumerator WaitForTap()
{
while (true)
{
if (Input.GetMouseButtonDown(0))
{
//do something
}
yield return 0;
}
}
or
void Update()
{
if (Input.GetMouseButtonDown(0))
{
//do something
}
}
Say that I would want to record the timestamp of the tap in //do something - would there be a difference in precision between the two?