private IEnumerator LoadAsync(string id, SceneDelegate sceneCallback = null) { loader = SceneManager.LoadSceneAsync(id, LoadSceneMode.Single); yield return(loader); sceneCallback?.Invoke(); }
protected override void OnUpdateFrame(FrameEventArgs e) { base.OnUpdateFrame(e); dt = (float)e.Time; updater?.Invoke(e); }
protected override void OnRenderFrame(FrameEventArgs e) { base.OnRenderFrame(e); renderer?.Invoke(e); GL.Flush(); SwapBuffers(); }
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(); } } )); } }