public static string EncodeBundleName(string name) { if (name.EndsWith(".ab")) { return(name); } return(ALG.EncodeHexString(name) + ".ab"); }
public static void BuildAssetBundle(string path) { AssetBundleBuild abb = new AssetBundleBuild(); abb.assetNames = new string[] { path }; abb.assetBundleName = ALG.EncodeHexString(Path.GetFileNameWithoutExtension(path)) + ".ab"; BuildPipeline.BuildAssetBundles(FilePathDefine.projectExportPath, new AssetBundleBuild[] { abb }, babo, EditorUserBuildSettings.activeBuildTarget); }
/// <summary> /// 加载manifest /// </summary> private void LoadManifest() { foreach (string path in FilePathDefine.loadedPath) { var _path = Path.Combine(path, ALG.EncodeHexString(FilePathDefine.platform)); if (File.Exists(_path)) { var bundleLoadRequest = AssetBundle.LoadFromFile(_path); _abManifest = bundleLoadRequest.LoadAsset <AssetBundleManifest>("AssetBundleManifest"); Debug.Log(_abManifest); return; } } }