Пример #1
0
        private IEnumerator OnLoadSceneAsync(string sceneName, bool additive)
        {
            progress = 0;
            isDone   = false;
            // var loadSceneMode = additive ? UnityEngine.SceneManagement.LoadSceneMode.Additive : UnityEngine.SceneManagement.LoadSceneMode.Single;
            // var async = UnityEngine.SceneManagement.SceneManager.LoadSceneAsync(sceneName, loadSceneMode);
            var async = AssetsManger.LoadSceneAsync(sceneName, additive);

            _loading.Add(sceneName, async);
            while (!async.isDone)
            {
                if (async.progress >= 0.9f)
                {
                    Progress(1.0f);
                }
                else
                {
                    Progress(async.progress);
                }

                yield return(null);
            }
            _loaded.Add(sceneName, async);
            Completed(sceneName);
        }
Пример #2
0
 public void Load()
 {
     request = AssetsManger.LoadSceneAsync(url, isAdditive);
 }