BuildPipeline
.BuildAssetBundles(
"AssetBundle"
);
This code is deprecated in VS, but this problem can still be seen in many old versions.
So how to fix this problem
Please refer to the code below.
public
class
CreatAssetBundle
{
[
MenuItem
(
"Assets/Buid AssetBundle"
)]
//This code can add a button under the directory
static
void
BuildAllAssetsBundles()
{
BuildPipeline.BuildAssetBundles("AssetBundle",BuildAssetBundleOptions.None,
BuildTarget
.StandaloneWindows
);
// use this code to package the file
//AssetBundle represents the file name. That is to say
, create an AssetBundle file in this project directory in advance
.
//The second parameter (BuildAssetBundleOptions.None) represents AssetBundle Build Option
//The third parameter is the platform
}
}