private IEnumerator LoadAsync(string id, SceneDelegate sceneCallback = null) { loader = SceneManager.LoadSceneAsync(id, LoadSceneMode.Single); yield return(loader); sceneCallback?.Invoke(); }
public void RunScene(SceneDelegate toRun) { StopRunningScene(); RunningScene = (new Thread(() => { toRun(); })); RunningScene.Start(); }
private void ChangeScene(Scene pScene) { scene = pScene; entityManager.SetEntities(scene.name); // Set the title of the window Title = scene.name; // Set the Render and Update delegates to the Update and Render methods of this class updater = scene.Update; renderer = scene.Render; }
public void StartLoadAsync(string[] ids, SceneDelegate sceneCallback = null) { var required = ids.Length; var current = 0; foreach (var id in ids) { Loader.StartCoroutine(LoadAsync(id, () => { current++; if (required == current) { sceneCallback?.Invoke(); } } )); } }