예제 #1
0
 public static string EncodeBundleName(string name)
 {
     if (name.EndsWith(".ab"))
     {
         return(name);
     }
     return(ALG.EncodeHexString(name) + ".ab");
 }
예제 #2
0
    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);
    }
예제 #3
0
 /// <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;
         }
     }
 }