In my game I have main menu through which I start new game and execute script below. But when I go back to the main menu and start new game again, script below doesn’t work. I tried to stop coroutine inside Start function, but it doesn’t helped
private IEnumerator OpenCloseEyesAnimation()
{
if (!isOpenEyesAnimationStarted)
{
isOpenEyesAnimationStarted = true;
openCloseEyes.OpenCloseDoor();
yield return new WaitForSeconds(6.0f); // this line don't work after second launch
stepNumber++;
isOpenEyesAnimationStarted = false;
}
}