Beispiel #1
0
        private IEnumerator LoadAsync(string id, SceneDelegate sceneCallback = null)
        {
            loader = SceneManager.LoadSceneAsync(id, LoadSceneMode.Single);
            yield return(loader);

            sceneCallback?.Invoke();
        }
Beispiel #2
0
 public void RunScene(SceneDelegate toRun)
 {
     StopRunningScene();
     RunningScene = (new Thread(() => {
         toRun();
     }));
     RunningScene.Start();
 }
Beispiel #3
0
        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;
        }
Beispiel #4
0
        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();
                    }
                }
                                                ));
            }
        }