Ejemplo n.º 1
0
        IEnumerator LoadAssetLevelProgress(AssetBundles.AssetBundleLoadOperation in_loadingOperation)
        {
            if (!in_loadingOperation.IsDone())
            {
                yield return(YieldFactory.GetWaitForEndOfFrame());
            }

            // now its done, load the level
#if UNITY_EDITOR
            if (AssetBundles.AssetBundleManager.SimulateAssetBundleInEditor)
            {
                TransitionLoadComplete();
            }
            else
#endif
            {
                AssetBundles.AssetBundleLoadLevelOperation loadingOperation = (AssetBundles.AssetBundleLoadLevelOperation)in_loadingOperation;
                while (loadingOperation == null || loadingOperation._Request == null)
                {
                    yield return(null);
                }

                if (Application.HasProLicense())
                {
                    StartCoroutine(LoadLevelProgressProLicense(loadingOperation._Request));
                }
                else
                {
                    StartCoroutine(LoadLevelProgress(loadingOperation._Request));
                }
            }
        }
Ejemplo n.º 2
0
        IEnumerator LoadAssetLevelProgress(AssetBundles.AssetBundleLoadOperation in_loadingOperation, string in_name)
        {
            AssetBundles.AssetBundleLoadLevelOperation loadLevelOperation = in_loadingOperation as AssetBundles.AssetBundleLoadLevelOperation;
            ms_fillAmount = 0.0f;
            while (!in_loadingOperation.IsDone())
            {
                UpdateAssetBundleLoading(loadLevelOperation);
                yield return(YieldFactory.GetWaitForEndOfFrame());
            }

            // now its done, load the level
#if UNITY_EDITOR
            if (AssetBundles.AssetBundleManager.SimulateAssetBundleInEditor)
            {
                TransitionLoadComplete();
            }
            else
#endif
            {
                AssetBundles.AssetBundleLoadLevelOperation loadingOperation = (AssetBundles.AssetBundleLoadLevelOperation)in_loadingOperation;
                ms_fillAmount = 0.0f;
                while (!loadingOperation.IsDone())
                {
                    UpdateAssetBundleLoading(loadLevelOperation);
                    yield return(loadingOperation);
                }

                if (Application.HasProLicense())
                {
                    StartCoroutine(LoadLevelProgressProLicense(loadingOperation._Request));
                }
                else
                {
                    StartCoroutine(LoadLevelProgress(loadingOperation._Request));
                }
            }
        }