GetAllAssetBundles() private method

private GetAllAssetBundles ( ) : string[]
return string[]
コード例 #1
0
 static public int GetAllAssetBundles(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);
         var ret = self.GetAllAssetBundles();
         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
ファイル: BundleManifest.cs プロジェクト: tsuixl/Frame
 private void ApplyManifest(AssetBundleManifest manifest)
 {
     string[] allbundleNames = manifest.GetAllAssetBundles();
     for (int i = 0; i < allbundleNames.Length; i++)
     {
         string name = allbundleNames[i];
         string[] depends = manifest.GetDirectDependencies(allbundleNames[i]);
         mManifest.Add(name, depends);
     }
 }
コード例 #4
0
 static public int GetAllAssetBundles(IntPtr l)
 {
     try {
         UnityEngine.AssetBundleManifest self = (UnityEngine.AssetBundleManifest)checkSelf(l);
         var ret = self.GetAllAssetBundles();
         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));
     }
 }
コード例 #6
0
 static int GetAllAssetBundles(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 1);
         UnityEngine.AssetBundleManifest obj = (UnityEngine.AssetBundleManifest)ToLua.CheckObject <UnityEngine.AssetBundleManifest>(L, 1);
         string[] o = obj.GetAllAssetBundles();
         ToLua.Push(L, o);
         return(1);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
コード例 #7
0
	static void BuildAllAssetBundles ()
	{
		assetBundleManifest = BuildPipeline.BuildAssetBundles ("Assets//StreamingAssets/bundle");
		AssetDatabase.Refresh();
		string[] allAssetBundles = assetBundleManifest.GetAllAssetBundles();
		foreach(var assetBundle in allAssetBundles){
			print("AssetBundleName: " + assetBundle);
//			string[] allDependencies = assetBundleManifest.GetAllDependencies(assetBundle);
//			foreach(var dependencie in allDependencies){
//				print("DependAssetBundleName: " + dependencie);
//			}
//			string[] directDependencies = assetBundleManifest.GetDirectDependencies(assetBundle);
//			foreach(var direct in directDependencies){
//				print("DirectDependAssetBundleName: " + direct);
//			}

			string assetsBundlePath = Application.streamingAssetsPath + "/bundle/" + assetBundle;

			if(bundle != null)
				bundle.Unload(true);
			bundle = AssetBundle.LoadFromFile(assetsBundlePath);

			string[] allAssetNames = bundle.GetAllAssetNames();
			foreach(var assetName in allAssetNames){
				print("AssetName: " + assetName);
//				string[] assetPath = AssetDatabase.GetAssetPathsFromAssetBundleAndAssetName(assetBundle, assetName);
//				foreach(var aPath in assetPath){
//					print("AssetPath: " + aPath);
//					string[] dependencie = AssetDatabase.GetDependencies(aPath);
//					foreach(var dep in dependencie){
//						print("Dependencie: " + dep);
//					}
//				}
			}
		}

	}
コード例 #8
0
        static AssetBundleManifest OutputResult(string resultFile, float useTime, UnityEngine.AssetBundleManifest manifest)
        {
            if (manifest == null)
            {
                return(null);
            }

            AssetBundleManifest result = new AssetBundleManifest();

            result.buildTime = useTime;
            List <AssetBundleManifest.AssetBundleBuild> bundles = new List <AssetBundleManifest.AssetBundleBuild>();

            foreach (var name in manifest.GetAllAssetBundles())
            {
                AssetBundleManifest.AssetBundleBuild bundle = new AssetBundleManifest.AssetBundleBuild();
                bundle.assetBundleName = name;
                bundle.dependency      = manifest.GetDirectDependencies(name);
                bundle.hash            = manifest.GetAssetBundleHash(name).ToString();
                bundles.Add(bundle);
            }
            result.builds = bundles.ToArray();
            File.WriteAllText(resultFile, JsonUtility.ToJson(result, true));
            return(result);
        }
コード例 #9
0
	private string[] GetAssetbundlesNeedsUpdate(AssetBundleManifest servermanifest, AssetBundleManifest localmanifest)
    {
        List<string> result = new List<string>();
        var allassets = servermanifest.GetAllAssetBundles();
        for (int i = 0; i < allassets.Length; i++)
        {
			Debug.Log("compare hash for bundle:" + allassets[i]);
            if (localmanifest.GetAssetBundleHash(allassets[i]).ToString() != servermanifest.GetAssetBundleHash(allassets[i]).ToString())
                result.Add(allassets[i]);
        }

        return result.ToArray();
    }
コード例 #10
0
ファイル: BundleManifest.cs プロジェクト: tsuixl/Frame
    public static BundleManifest CombineBundleManifest(string outputPath,AssetBundleManifest beforManifest, AssetBundleManifest nowManifest)
    {
        BundleManifest data = new BundleManifest(beforManifest);


        //  remove non exist
        List<string> removeList = new List<string>();
        foreach (var iter in data.mManifest)
        {
            if (File.Exists(outputPath + "/" + iter.Key) == false)
            {
                removeList.Add(iter.Key);
            }
        }

        for (int i = 0; i < removeList.Count; i++)
        {
            data.mManifest.Remove(removeList[i]);
        }


        string nowManifestName = string.Empty;
        string[] allNowManifest = nowManifest.GetAllAssetBundles();
        for (int i = 0; i < allNowManifest.Length; i++)
        {
            nowManifestName = allNowManifest[i];
            string[] nowDepend = nowManifest.GetDirectDependencies(nowManifestName);
            if (data.mManifest.ContainsKey(nowManifestName))
            {
                data.mManifest[nowManifestName] = nowDepend;
            }
            else
            {
                data.mManifest.Add(nowManifestName, nowDepend);
            }
        }

        return data;
    }
コード例 #11
0
ファイル: input.cs プロジェクト: fizz-yamashita/python_tools
	// =====ここからメソッド群=====
	
	// 作成したアセットバンドル情報を、ソートしたディクショナリー形式にして返す
	static private SortedDictionary<string, string> CreateAssetbundleSortedDictionary(AssetBundleManifest assetBundleManifest) {
		string[] allAssetBundles = assetBundleManifest.GetAllAssetBundles();
		SortedDictionary<string, string> forSortList = new SortedDictionary<string, string>();
		for( int i = 0; i < allAssetBundles.Length ; i++ ) {
			string hash = assetBundleManifest.GetAssetBundleHash( allAssetBundles[i] ).ToString();

			forSortList.Add(allAssetBundles[i], hash);
		}

		// 結果出力
		Debug.Log("=====SortedDictionary:OutputStart=====");
		foreach(var data in forSortList) {
			Debug.Log("key : " + data.Key + "/" + "Value : " + data.Value);
		}
		Debug.Log("=====SortedDictionary:OutputEnd=====");

		return forSortList;
	}