Exemple #1
0
    public static void BuildAssetBundles(string outputFile, ref List <AssetBundleBuild> allBundle, BuildAssetBundleOptions options = BuildAssetBundleOptions.None)
    {
        if (Directory.Exists(outputFile) == false)
        {
            Directory.CreateDirectory(outputFile);
        }

        var beforManifest = TryLoadBeforBundleManifest(outputFile);
        var nowManigest   = BuildPipeline.BuildAssetBundles(outputFile, allBundle.ToArray(), BuildAssetBundleOptions.None, BundleSetting.UnityBuildTarget);

        if (nowManigest != null && beforManifest != null)
        {
            var finalManifest = BundleManifest.CombineBundleManifest(outputFile, beforManifest, nowManigest);
            if (finalManifest != null)
            {
                finalManifest.SaveToFile(outputFile + "/ReleaseManifest");
            }
            else
            {
                Logged.LogColor("ff0000", string.Format("BundleManifest.CombineBundleManifest result is null!"));
            }
        }
        else
        {
            var finalManifest = new BundleManifest(nowManigest);
            finalManifest.SaveToFile(outputFile + "/ReleaseManifest");
        }
        Debug.Log(outputFile);
    }
Exemple #2
0
    public static void BuildAssetBundles(string outputFile, ref List<AssetBundleBuild> allBundle, BuildAssetBundleOptions options = BuildAssetBundleOptions.None)
    {
        if (Directory.Exists(outputFile) == false)
            Directory.CreateDirectory(outputFile);

        var beforManifest = TryLoadBeforBundleManifest(outputFile);
        var nowManigest = BuildPipeline.BuildAssetBundles(outputFile, allBundle.ToArray(), BuildAssetBundleOptions.None, BundleSetting.UnityBuildTarget);
        if (nowManigest != null && beforManifest != null)
        {
            var finalManifest = BundleManifest.CombineBundleManifest(outputFile, beforManifest, nowManigest);
            if (finalManifest != null)
            {
                finalManifest.SaveToFile(outputFile + "/ReleaseManifest");
            }
            else
            {
                Logged.LogColor("ff0000", string.Format("BundleManifest.CombineBundleManifest result is null!"));
            }
        }
        else
        {
            var finalManifest = new BundleManifest(nowManigest);
            finalManifest.SaveToFile(outputFile + "/ReleaseManifest");
        }
        Debug.Log(outputFile);
    }