Say I have something like:
function Update ()
{
if (Input.GetKeyDown(KeyCode.Escape))
{
StartCoroutine("myCoroutine");
}
if (Input.GetKeyDown("p"))
{
StopCoroutine("myCoroutine");
}
}
function myCoroutine ()
{
var t : float = 0;
while (t <= 1.0)
{
t += 0.1;
yield;
}
}
Does that mean the only part of the coroutine that gets repeated is the part within the while loop, and the t variable will not be reset to 0 (unless I press (Input.GetKeyDown(“P”) at some point)?? Much thanks!