3DTD/Assets/Scripts/UI/SceneTransition.cs

23 lines
462 B
C#
Raw Permalink Normal View History

2024-04-21 06:07:43 +02:00
using UnityEngine;
using UnityEngine.SceneManagement;
using System.Collections;
public class SceneTransition : MonoBehaviour
{
public void StartAnimation()
{
Animator ani = GetComponent<Animator>();
ani.SetTrigger("start");
StartCoroutine(ChangeSceneAfterAnimation());
}
IEnumerator ChangeSceneAfterAnimation()
{
yield return new WaitForSeconds(1.5f);
SceneManager.LoadScene("GameScene");
}
}