unity load scene
using UnityEngine.SceneManagement;
//Put this in whenever you want to load a scene
SceneManager.LoadScene("Scene name");
unity load scene
using UnityEngine.SceneManagement;
//Put this in whenever you want to load a scene
SceneManager.LoadScene("Scene name");
loading screen unity
using System.Collections;
using UnityEngine;
using UnityEngine.UI;
using UnityEngine.SceneManagement;
using TMPro;
public class LoadingScreen : MonoBehaviour
{
[HideInInspector]
private TextMeshProUGUI loadingText;
[HideInInspector]
private Slider loadingSlider;
public void LoadScene(int sceneNumber)
{
StartCoroutine(LoadSceneAsync(sceneNumber));
}
IEnumerator LoadSceneAsync(int sceneIndex)
{
AsyncOperation operation = SceneManager.LoadSceneAsync(sceneIndex);
while (!operation.isDone)
{
Debug.Log("Operation progress");
float progress = Mathf.Clamp01(operation.progress / 0.9f);
loadingText.text = Mathf.RoundToInt(progress * 100) + "%";
loadingSlider.value = progress;
yield return new WaitForEndOfFrame();
}
}
}
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us