I know how to load a scene. I need a loading scene for cell phones. I don’t want input key when loading scene done loading. I want the scene to just switch over on it own. I going to add a picture too in the loading scene. I just need help getting started. An example of the loading scene would be something like this :
Loading …
Behind loading text is a picture showing .
I normally make a loading scene. I start in the menu, click play. I open my loading scene, a few seconds later I load my game scene.
A simple solution using NGUI’s Progress Slider:
using UnityEngine;
using System.Collections;
using UnityEngine.SceneManagement;
public class IntroScene_Loader : MonoBehaviour
{
private UISlider progress;
// Use this for initialization
void Start ()
{
progress = GameObject.Find("LoadProgressBar").GetComponent<UISlider>();
StartCoroutine(loadAsync("MainGameScene"));
}
private IEnumerator loadAsync(string levelName)
{
AsyncOperation operation = SceneManager.LoadSceneAsync(levelName);
while (!operation.isDone)
{
yield return operation.isDone;
progress.value = operation.progress;
}
}
}
This way, when the “Preloader” scene is loaded, it’s an Asynchronous load. When the scene is loaded, it’ll just switch over.
You could play with it a bit more, then when the scene is loaded, wait for a keypress, etc.