at the end of the game window appears GameOver. I press F1 and do a restart, now GameOver window appears instantly. Here is a script that is on it.
public class gameOver : MonoBehaviour {
public static bool isGO = false;
public Animator anim;
public static bool restart = false;
void Start ()
{
anim = GetComponent<Animator>();
}
void Update ()
{
if(isGO)
{
anim.SetBool("isGameOver", true);
}
if (Input.GetKey(KeyCode.F1))
{
Application.LoadLevel(1);
}
}
}
Why GameOver window appears immediately?