コード例 #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));
                }
            }
        }
コード例 #2
0
        private void StartLoadingAssetBundleLevelNow(string in_assetBundleTag, string in_name)
        {
            // Load next level.
            AssetBundles.AssetBundleLoadOperation loadingOperation = AssetBundles.AssetBundleManager.LoadLevelAsync(in_assetBundleTag, in_name, m_isLoadingAdditive);

            if (Application.HasProLicense())
            {
                StartCoroutine(LoadAssetLevelProgress(loadingOperation));
            }
            else
            {
                TransitionLoadComplete();
            }
        }
コード例 #3
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));
                }
            }
        }