Hello I have animation added on button and on click event .On click new scene is entered but animation not even shown.How to finish animation before scene load?
Just to let you know i m beginner at this.
Just make delay between starting animation and starting loading scene. You can do this by coroutine or Invoke method.
public void animScene()
{
anim.Play();
Invoke("LoadScene", delay);
}
void LoadScene()
{
SceneManager.LoadScene(Scene);
}`
Or with coroutine
public void animScene()
{
StartCoroutine(loadCoroutine());
}
IEnumerator loadCoroutine()
{
anim.Play();
yield return new WaitForSeconds(animTime);
SceneManager.LoadScene(Scene);
}