GetAllDependencies() private method

private GetAllDependencies ( string assetBundleName ) : string[]
assetBundleName string
return string[]
コード例 #1
0
 static public int GetAllDependencies(IntPtr l)
 {
     try {
                     #if DEBUG
         var    method     = System.Reflection.MethodBase.GetCurrentMethod();
         string methodName = GetMethodName(method);
                     #if UNITY_5_5_OR_NEWER
         UnityEngine.Profiling.Profiler.BeginSample(methodName);
                     #else
         Profiler.BeginSample(methodName);
                     #endif
                     #endif
         UnityEngine.AssetBundleManifest self = (UnityEngine.AssetBundleManifest)checkSelf(l);
         System.String a1;
         checkType(l, 2, out a1);
         var ret = self.GetAllDependencies(a1);
         pushValue(l, true);
         pushValue(l, ret);
         return(2);
     }
     catch (Exception e) {
         return(error(l, e));
     }
             #if DEBUG
     finally {
                     #if UNITY_5_5_OR_NEWER
         UnityEngine.Profiling.Profiler.EndSample();
                     #else
         Profiler.EndSample();
                     #endif
     }
             #endif
 }
コード例 #2
0
        public static AssetBundleManifest Create(UnityEngine.AssetBundleManifest manifest)
        {
            AssetBundleManifest result = new AssetBundleManifest()
            {
                Version = DateTime.Now.ToString("yyyyMMddHHmmss")
            };

            if (manifest == null)
            {
                return(result);
            }

            List <string> assetbundleNames = new List <string>();

            assetbundleNames.AddRange(manifest.GetAllAssetBundles());
            foreach (var name in assetbundleNames)
            {
                AssetBundleInfo info = new AssetBundleInfo()
                {
                    AssetBundleName = name,
                    Hash128         = manifest.GetAssetBundleHash(name).ToString()
                };
                info.AssetPaths.AddRange(AssetDatabase.GetAssetPathsFromAssetBundle(name));
                var dependencies = manifest.GetAllDependencies(name);
                foreach (var depName in dependencies)
                {
                    info.Dependencies.Add(assetbundleNames.IndexOf(depName));
                }
                result.Infos.Add(info);
            }
            return(result);
        }
コード例 #3
0
 static public int GetAllDependencies(IntPtr l)
 {
     try {
         UnityEngine.AssetBundleManifest self = (UnityEngine.AssetBundleManifest)checkSelf(l);
         System.String a1;
         checkType(l, 2, out a1);
         var ret = self.GetAllDependencies(a1);
         pushValue(l, ret);
         return(1);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
 public void AddUnityManifest(UnityEngine.AssetBundleManifest manifest)
 {
     if (manifest == null)
     {
         return;
     }
     string[] inOriginList = manifest.GetAllAssetBundles();
     foreach (var origin in inOriginList)
     {
         allAssetBundles.Add(origin);
         allDependencies.Add(origin, manifest.GetAllDependencies(origin));
         allHash.Add(origin, manifest.GetAssetBundleHash(origin));
     }
 }
コード例 #5
0
 static int GetAllDependencies(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 2);
         UnityEngine.AssetBundleManifest obj = (UnityEngine.AssetBundleManifest)ToLua.CheckObject <UnityEngine.AssetBundleManifest>(L, 1);
         string   arg0 = ToLua.CheckString(L, 2);
         string[] o    = obj.GetAllDependencies(arg0);
         ToLua.Push(L, o);
         return(1);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
コード例 #6
0
        public static IEnumerator LoadAssetBundle(string Fdirctory, string FassetBundleName)
        {
            string[]      dps  = assetBundleManifest.GetAllDependencies(FassetBundleName);
            AssetBundle[] temp = new AssetBundle[dps.Length];
            for (int i = 0; i < dps.Length; i++)
            {
                WWW www = WWW.LoadFromCacheOrDownload(dps[i], assetBundleManifest.GetAssetBundleHash(dps[i]));
                yield return(www);

                temp[i] = www.assetBundle;
            }

            WWW tar = WWW.LoadFromCacheOrDownload(Fdirctory + FassetBundleName, assetBundleManifest.GetAssetBundleHash(FassetBundleName));

            yield return(tar);

            AssetBundle t = tar.assetBundle;
        }
コード例 #7
0
        public static IEnumerator LoadAssetBundle()
        {
            string url  = Application.streamingAssetsPath + "/AssetBundles/";
            string path = CFG.WWWstreamingAssetsPathPrefix + url + "AssetBundles";
            WWW    nwww = WWW.LoadFromCacheOrDownload(path, 0);

            yield return(nwww);

            if (string.IsNullOrEmpty(nwww.error))
            {
                AssetBundle         mab  = nwww.assetBundle;
                UnityEngine.Object  g0   = mab.LoadAsset("AssetBundleManifest");
                AssetBundleManifest main = g0 as AssetBundleManifest;
                mab.Unload(false);

                string[]      dps  = main.GetAllDependencies("Commen");
                AssetBundle[] temp = new AssetBundle[dps.Length];
                foreach (var item in dps)
                {
                    WWW durkl = WWW.LoadFromCacheOrDownload(item, main.GetAssetBundleHash(item));
                    yield return(durkl);

                    temp[0] = durkl.assetBundle;
                }

                WWW tar = WWW.LoadFromCacheOrDownload(CFG.WWWstreamingAssetsPathPrefix + url + "Commen", main.GetAssetBundleHash("Commen"), 0);
                yield return(tar);

                AssetBundle t   = tar.assetBundle;
                Sprite      _tt = t.LoadAsset <Sprite>("20");
                GameObject  g   = new GameObject();
                var         r   = g.AddComponent <SpriteRenderer>();
                r.sprite = _tt;
            }
            else
            {
#if UNITY_EDITOR || Development
                Debuger.Log(nwww.error);
#endif
            }
        }
コード例 #8
0
ファイル: Loader.cs プロジェクト: lin5/MMDARPG
        /// <summary>
        /// 加载资源包
        /// </summary>
        /// <param name="dirctory"></param>
        /// <param name="assetBundleName"></param>
        /// <returns></returns>
        public static IEnumerator LoadAssetBundle(string dirctory, string assetBundleName)
        {
            ///如果assetBundleManifest为空,结束加载。
            if (assetBundleManifest == null)
            {
                yield break;
            }

            string[]      dps  = assetBundleManifest.GetAllDependencies(assetBundleName);
            AssetBundle[] temp = new AssetBundle[dps.Length];
            for (int i = 0; i < dps.Length; i++)
            {
                WWW www = WWW.LoadFromCacheOrDownload(dps[i], assetBundleManifest.GetAssetBundleHash(dps[i]));
                yield return(www);

                temp[i] = www.assetBundle;
            }

            WWW tar = WWW.LoadFromCacheOrDownload(dirctory + assetBundleName, assetBundleManifest.GetAssetBundleHash(assetBundleName));

            yield return(tar);

            AssetBundle t = tar.assetBundle;
        }