Example #1
0
        public void LoadSceneAsync(string path, OnLoaded_Void onLoaded, LoadSceneMode mode = LoadSceneMode.Single)
        {
            if (string.IsNullOrEmpty(path))
            {
                onLoaded();
            }

            if (loadMode == LoadMode.Original)
            {
                var request = OriginalResourceLoader.LoadSceneAsync(path, mode);
                keysToAdd.Add(new AsyncRequest(request), new LoadFinishCallback(onLoaded, LoadFinishCallback.Type.TypeVoid));
            }
            else if (loadMode == LoadMode.AssetBundle)
            {
                var request = bundleResourceLoader.LoadSceneAsync(path, mode);
                keysToAdd.Add(new AsyncRequest(request), new LoadFinishCallback(onLoaded, LoadFinishCallback.Type.TypeVoid));
            }
#if UNITY_EDITOR
            else if (loadMode == LoadMode.Editor)
            {
                var request = OriginalResourceLoader.LoadSceneAsync(path, mode);
                keysToAdd.Add(new AsyncRequest(request), new LoadFinishCallback(onLoaded, LoadFinishCallback.Type.TypeVoid));
            }
#endif
        }