Exemplo n.º 1
0
        private IEnumerator LoadAssetBundle(string assetBundlePath, LoadRequestBase assetLoadRequest)
        {
            // Wait for the Caching system to be ready
            while (!Caching.ready)
            {
                yield return(null);
            }

            using (WWW www = WWW.LoadFromCacheOrDownload(assetBundlePath, data.bundleVersion))
            {
                yield return(www);

                if (www.error != null)
                {
                    throw new System.Exception("AssetBundle - WWW download:" + www.error);
                }
                assetLoadRequest.assetBundle = www.assetBundle;

                www.Dispose();
            }
        }
        private IEnumerator LoadAssetBundle(string assetBundlePath, LoadRequestBase assetLoadRequest)
        {
            // Wait for the Caching system to be ready
            while (!Caching.ready)
            {
                yield return null;
            }

            using (WWW www = WWW.LoadFromCacheOrDownload(assetBundlePath, data.bundleVersion))
            {
                yield return www;
                if (www.error != null)
                {
                    throw new System.Exception("AssetBundle - WWW download:" + www.error);
                }
                assetLoadRequest.assetBundle = www.assetBundle;

                www.Dispose();
            }
        }