| | |
| | | |
| | | public class AssetBundleBuildExtersion
|
| | | {
|
| | | public static void Build(string output, string category, BuildAssetBundleOptions bundleOption, BuildTarget buildTarget)
|
| | | public static void Build(string output, string category, BuildAssetBundleOptions bundleOption, BuildTarget buildTarget, bool rebuild = true)
|
| | | {
|
| | | var assetBundles = AssetDatabase.GetAllAssetBundleNames();
|
| | | var targetAssetBundles = new List<string>();
|
| | |
| | | var manifest = StringUtility.Contact(output, Path.AltDirectorySeparatorChar, GetMainFestFileName(buildTarget), ".manifest");
|
| | | var manifestRename = StringUtility.Contact(output, Path.AltDirectorySeparatorChar, category, "_assetbundle.manifest");
|
| | |
|
| | | if (Directory.Exists(rootPath))
|
| | | {
|
| | | if (rebuild && Directory.Exists(rootPath))
|
| | | Directory.Delete(rootPath, true);
|
| | | }
|
| | |
|
| | | Directory.CreateDirectory(rootPath);
|
| | | // if (!Directory.Exists(rootPath))
|
| | | // Directory.CreateDirectory(rootPath);
|
| | |
|
| | | if (File.Exists(mainFileRename))
|
| | | {
|
New file |
| | |
| | | using UnityEngine; |
| | | using UnityEditor; |
| | | using System.IO; |
| | | using System.Collections.Generic; |
| | | |
| | | namespace Assets.Editor.Tool |
| | | |
| | | { |
| | | public class AssetBundleBuildTool |
| | | { |
| | | [MenuItem("Tools/AB增量打包(不设置Label)")] |
| | | static void DoIt() |
| | | { |
| | | BuildAssetBundleOptions opt = BuildAssetBundleOptions.ChunkBasedCompression | BuildAssetBundleOptions.DeterministicAssetBundle | BuildAssetBundleOptions.StrictMode; |
| | | string outputPath = StringUtility.Contact(Application.streamingAssetsPath, Path.AltDirectorySeparatorChar, EditorUserBuildSettings.activeBuildTarget.ToString()); |
| | | if (!Directory.Exists(outputPath)) |
| | | Directory.CreateDirectory(outputPath); |
| | | |
| | | AssetBundleBuildExtersion.Build(outputPath, "builtin", opt, EditorUserBuildSettings.activeBuildTarget,false); |
| | | |
| | | AssetBundleBuildExtersion.Build(outputPath, "audio", opt, EditorUserBuildSettings.activeBuildTarget,false); |
| | | |
| | | AssetBundleBuildExtersion.Build(outputPath, "mobeffectshader", opt, EditorUserBuildSettings.activeBuildTarget,false); |
| | | |
| | | AssetBundleBuildExtersion.Build(outputPath, "config", opt, EditorUserBuildSettings.activeBuildTarget,false); |
| | | TableTool.CopyConfigsToOutPutPath(StringUtility.Contact(outputPath, "/config")); |
| | | |
| | | LuaBuildHelper.OnPreBuild(); |
| | | UpdateLuaSetting.SetAllLuaAssetBundleName(); |
| | | AssetBundleBuildExtersion.Build(outputPath, "lua", opt, EditorUserBuildSettings.activeBuildTarget,false); |
| | | LuaBuildHelper.OnPostBuild(); |
| | | |
| | | AssetBundleBuildExtersion.Build(outputPath, "maps", opt, EditorUserBuildSettings.activeBuildTarget,false); |
| | | |
| | | AssetBundleBuildExtersion.Build(outputPath, "ui", opt, EditorUserBuildSettings.activeBuildTarget,false); |
| | | } |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 05891236d737b6346978914f9a70efcb |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| | |
| | | using UnityEditor;
|
| | | using System.IO;
|
| | |
|
| | | public class UpdateAllSetting
|
| | | {
|
| | |
|
| | | [MenuItem("程序/设置资源包名/更新全部AssetBundleName")]
|
| | | public static void SetAllAssetBundleName()
|
| | | { |
| | | UpdateSpriteSetting.SetAllSpriteAssetBundleName();
|
| | | UpdateUIWindowSetting.SetAllUIWindowAssetBundleName();
|
| | | UpdateUIPrefabSetting.SetAllUIPrefabAssetBundleName();
|
| | | UpdateEffectPrefabSetting.SetAllEffectPrefabAssetBundleName();
|
| | | UpdateMobSetting.SetAllMobAssetBundleName();
|
| | | UpdateShaderSetting.SetAllShaderAssetBundleName();
|
| | | UpdateScriptableObjectsSetting.SetAllScriptableObjectAssetBundleName();
|
| | | UpdateLevelSetting.SetAllLevelAssetBundleName();
|
| | | UpdateAudioSetting.SetAllAudioAssetBundleName();
|
| | | UpdateVideoSetting.SetAllVideoAssetBundleName();
|
| | | UpdateLuaSetting.SetAllLuaAssetBundleName();
|
| | | UpdateBuiltInSetting.SetBuiltinAssetBundleName();
|
| | | }
|
| | | }
|
| | |
|
| | | public class UpdateSpriteSetting
|
| | | {
|
| | |
|