- 最后登录
- 2019-12-25
- 注册时间
- 2012-8-24
- 阅读权限
- 90
- 积分
- 71088
- 纳金币
- 52336
- 精华
- 343
|
- [MenuItem("Framework/SetABNameExtenAndBulidResource")]
- static void SetBundleNameBuilResource()
- {
- Object[] selects = Selection.objects;
- AssetBundleBuild[] buildMap = new AssetBundleBuild[selects.Length];
- string[] paths = new string[selects.Length];
- for(int i = 0;i < selects.Length; i++)
- {
- //AssetBundleBuild[] buildMap = new AssetBundleBuild[2];
- paths[i] = AssetDatabase.GetAssetPath(selects[i]);
- AssetImporter asset = AssetImporter.GetAtPath(paths[i]);
- asset.assetBundleName = selects[i].name;
- asset.assetBundleVariant = "<a target="_blank" class="relatedlink">unity3d</a>";
- buildMap[i].assetBundleName = selects[i].name;
- buildMap[i].assetBundleVariant = "unity3d";
- string[] enemyAssets = new string[1];
- enemyAssets[0] = paths[i];
- buildMap[i].assetNames = enemyAssets;
- }
- BuildPipeline.BuildAssetBundles("Assets/ABs",buildMap, BuildAssetBundleOptions.None,BuildTarget.WebGL);
- AssetDatabase.Refresh();
- }
复制代码 来自: 仅为年时
|
|