Example #1
0
        AssetBundle LoadSyncCoroutine(string path)
        {
            Debug.Log("path - " + path);

            AssetBundle ab = AssetbundleHelp.LoadFromFile(path);

            if (ab == null)
            {
                Debug.LogError("assetbundle loadFromFile error:");
            }
            path = path.Replace("/", "\\");
            string localpath = AssetBundleInfo.assetPath_local;

            localpath = localpath.Replace("/", "\\");
            string assetbundlename = path.Replace(localpath + "\\", "");

            Debug.Log("assetbundlename:" + assetbundlename + " localpath:" + localpath);
            string[] dependencies = AssetBundleInfo.Manifest.GetAllDependencies(assetbundlename);
            for (int i = 0; i < dependencies.Length; i++)
            {
                Debug.Log("dependencies:" + dependencies[i]);
                //if(!rememberList.Contains(localpath + "\\" + dependencies[i]))
                AssetBundle child = AssetbundleHelp.LoadFromFile(localpath + "\\" + dependencies[i]);
                if (child != null)
                {
                    child.LoadAllAssets();
                }
            }
            return(ab);
        }
Example #2
0
        void LoadFromFileDependices(string fullname)
        {
            string      dir      = fullname.Substring(0, fullname.LastIndexOf('/')) + "/";
            string      filename = fullname.Substring(fullname.LastIndexOf('/') + 1);
            AssetBundle ab       = AssetbundleHelp.LoadFromFile(fullname);

            string[] dependencies = AssetBundleInfo.Manifest.GetAllDependencies(filename);
            for (int i = 0; i < dependencies.Length; i++)
            {
                AssetBundle child = AssetbundleHelp.LoadFromFile(dir + dependencies[i]);
                child.LoadAllAssets();
            }
            ab.LoadAllAssets();
        }