using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.SceneManagement;

public class SceneLoader : MonoBehaviour{

    public GameObject fade;

    public void LoadScene(int scene){
        StartCoroutine(SceneLoad(scene));
        fade.SetActive(true);
    }

    IEnumerator SceneLoad(int scene){
        yield return new WaitForSecondsRealtime(1f);
        SceneManager.LoadSceneAsync(scene);
    }
}
