Search Unity

Bug CompatabilityBuildPipeline does not pass on AssetBundleStripUnityVersion

Discussion in 'Asset Bundles' started by yangskybox, Aug 18, 2021.

  1. yangskybox

    yangskybox

    Joined:
    Oct 4, 2019
    Posts:
    3
    CompatibilityBuildPipeline.BuildAssetBundles(...) does not propagate BuildAsetBundleOptions.AssetBundleStripUnityVersion flag to ContentPipeLine.

    This is the current code in the package in version 1.15.2:

    Code (CSharp):
    1.         internal static CompatibilityAssetBundleManifest BuildAssetBundles_Internal(string outputPath, IBundleBuildContent content, BuildAssetBundleOptions options, BuildTarget targetPlatform)
    2.         {
    3.             // ** snip **
    4.  
    5. #if UNITY_2018_3_OR_NEWER
    6.             if ((options & BuildAssetBundleOptions.ChunkBasedCompression) != 0)
    7.                 parameters.BundleCompression = BuildCompression.LZ4;
    8.             else if ((options & BuildAssetBundleOptions.UncompressedAssetBundle) != 0)
    9.                 parameters.BundleCompression = BuildCompression.Uncompressed;
    10.             else
    11.                 parameters.BundleCompression = BuildCompression.LZMA;
    12. #else
    13.             if ((options & BuildAssetBundleOptions.ChunkBasedCompression) != 0)
    14.                 parameters.BundleCompression = BuildCompression.DefaultLZ4;
    15.             else if ((options & BuildAssetBundleOptions.UncompressedAssetBundle) != 0)
    16.                 parameters.BundleCompression = BuildCompression.DefaultUncompressed;
    17.             else
    18.                 parameters.BundleCompression = BuildCompression.DefaultLZMA;
    19. #endif
    20.  
    21.             if ((options & BuildAssetBundleOptions.DisableWriteTypeTree) != 0)
    22.                 parameters.ContentBuildFlags |= ContentBuildFlags.DisableWriteTypeTree;
    23.  
    24.             IBundleBuildResults results;
    25.             ReturnCode exitCode = ContentPipeline.BuildAssetBundles(parameters, content, out results);
    26.             if (exitCode < ReturnCode.Success)
    27.                 return null;
    28.  
    29.             // ** snip **
    30.         }
     
unityunity