Esempio n. 1
0
        public IEnumerator LoadedAsset(AssetBundleManager assetBundleManager, string assetBundleName, string assetName)
        {
            assetBundleName = assetBundleManager.RemapVariantName(assetBundleName);
            bundleLoaded    = assetBundleManager.LoadAssetBundleAsync(assetBundleName);
            yield return(bundleLoaded);

            AssetBundleRequest request = bundleLoaded.assetBundle.LoadAssetAsync <MultiSceneSetup>(assetName);

            yield return(request);

            MultiSceneSetup multiSceneSetup = request.asset as MultiSceneSetup;

            if (multiSceneSetup != null)
            {
                maxLoaded = multiSceneSetup.scenePaths.Length;
                for (int i = 0; i < multiSceneSetup.scenePaths.Length; i++)
                {
                    indexLoaded = i;
                    string bundleName;
                    if (!assetBundleManager.GetBundleName(multiSceneSetup.scenePaths[i], out bundleName))
                    {
                        continue;
                    }
                    yield return(LoadedAsset(assetBundleManager, bundleName, Path.GetFileNameWithoutExtension(multiSceneSetup.scenePaths[i])));
                }
            }
            indexLoaded = maxLoaded;
        }
Esempio n. 2
0
        public IEnumerator LoadedAsset(AssetBundleManager assetBundleManager, string assetBundleName, string sceneName, LoadSceneMode mode)
        {
            assetBundleName = assetBundleManager.RemapVariantName(assetBundleName);
            bundleLoaded    = assetBundleManager.LoadAssetBundleAsync(assetBundleName);
            yield return(bundleLoaded);

            operation = SceneManager.LoadSceneAsync(sceneName, mode);
            operation.allowSceneActivation = !notActivatedScene;
        }
        public IEnumerator LoadedAsset(AssetBundleManager assetBundleManager, string assetBundleName, string assetName, System.Type type)
        {
            assetBundleName = assetBundleManager.RemapVariantName(assetBundleName);
            bundleLoaded    = assetBundleManager.LoadAssetBundleAsync(assetBundleName);
            yield return(bundleLoaded);

            if (bundleLoaded.assetBundle != null)
            {
                request        = bundleLoaded.assetBundle.LoadAssetAsync(assetName, type);
                this.assetName = assetName;
            }
            isCompleted = true;
        }