Load target scene by going first to the loading screen.
This function is designed for you to be able to call it from Unity Events in the inspector, like the On Click call from UI Buttons. You can also call it from code.
public void LoadScene(SceneReference targetSceme);
public void LoadScene(string targetScene);
targetScene | SceneReferene object that holds a reference to the scene that will be loaded after the loading screen. |
---|---|
targetScene | string Name of the scene to load after the loading screen. |
using UnityEngine;
using UnityEngine.SceneManagement;
public class LoadSceneOnStart : MonoBehaviour
{
public LoadingScreen loadingScreen;
public SceneReference targetScene;
void Start()
{
loadingScreen.**LoadScene**(targetScene);
}
}