//加载本地 UpdateConif.txt
    IEnumerator LoadlocalUpdateConif()
    {
        string path = AssetPath.AssetBundlePath() + "UpdataConfig.txt";
        WWW    www  = new WWW(path);

        yield return(www);

        if (www.error == null)
        {
            string[] Arrys = www.text.Split(new char[2] {
                '\n', '|'
            });
            for (int i = 0; i < Arrys.Length - 1; i++)
            {
                string key = Arrys[i];
                i++;
                string value = Arrys[i];
                m_localupdataConifDic.Add(key, value);
            }
            StartCoroutine(LoadwwwUpdateConif());
        }
        else
        {
            Debug.Log(" ------www.error--------" + www.error);
        }
    }
    private WWW SetBundleDependence(string _ABname)
    {
        string[]      depNames           = manifest.GetAllDependencies(_ABname);
        AssetBundle[] dependsAssetbundle = new AssetBundle[depNames.Length];
        string        Path2 = "";

        for (int index = 0; index < depNames.Length; index++)
        {
            Path2 = AssetPath.AssetBundlePath() + depNames[index];
            //WWW www = GetLoadWWW(Path2);
            WWW www = resload.getww(Path2);
            if (www.error == null)
            {
                if (m_assetBundleManager == null)
                {
                    Debug.Log("ppStart.Instanc");
                }
                if (!m_assetBundleManager.FindmBundleDependenceDic(Path2))
                {
                    dependsAssetbundle[index] = www.assetBundle;
                    m_assetBundleManager.ADDBundleDependenceDic(Path2, dependsAssetbundle[index]);
                }
            }
        }
        Path2 = AssetPath.AssetBundlePath() + _ABname;
        //WWW www1 = GetLoadWWW(Path2);
        WWW www1 = resload.getww(Path2);

        return(www1);
    }
Example #3
0
    IEnumerator LoadAssetBundle(string name)
    {
        //AssetBundle manifestBundle = AssetBundle.LoadFromFile("file://" + Application.streamingAssetsPath + "/Android/Android");
        string Path = AssetPath.AssetBundleManifestPath();
        WWW    www  = new WWW(Path);

        yield return(www);

        if (www.error == null)
        {
            AssetBundle manifestBundle = www.assetBundle;
            manifest = (AssetBundleManifest)manifestBundle.LoadAsset("AssetBundleManifest");
            manifestBundle.Unload(false);

            string[] depNames = manifest.GetAllDependencies(name);
            Debug.Log("depNames length = " + depNames.Length.ToString());
            AssetBundle[] dependsAssetbundle = new AssetBundle[depNames.Length];
            string        Path2 = "";
            for (int index = 0; index < depNames.Length; index++)
            {
                Debug.Log("depNames---" + depNames[index]);
                string ABname = depNames[index].Replace(".myab", "");
                Debug.Log("ABname---" + ABname);
                Path2 = AssetPath.AssetBundlePath() + depNames[index];
                StartCoroutine(LoadAssetBundle(Path2, dependsAssetbundle[index], ABname));
            }
            //string Path3 = AssetPath.AssetBundlePath() + "cube03.myab";
            //  StartCoroutine(LoadAssetBundle1(Path3));
        }
        else
        {
            Debug.Log("www====" + www.error.ToString());
            t.text = "wwwh =" + www.error.ToString();
        }
    }