| | |
| | | |
| | | using UnityEngine.AssetBundles.AssetBundleDataSource; |
| | | using Assets.Editor.Tool; |
| | | using IFix.Editor; |
| | | |
| | | namespace UnityEngine.AssetBundles |
| | | { |
| | |
| | | EditorApplication.delayCall += ExcuteBuildMobEffectShader; |
| | | } |
| | | |
| | | if (GUILayout.Button("patch")) |
| | | { |
| | | EditorApplication.delayCall += ExcuteBuildPatch; |
| | | } |
| | | |
| | | EditorGUILayout.EndHorizontal(); |
| | | |
| | | EditorGUILayout.Space(); |
| | |
| | | ExcuteBuildUI(); |
| | | ExcuteBuildBuiltIn(); |
| | | ExcuteBuildLua(); |
| | | ExcuteBuildPatch(); |
| | | |
| | | AssetDatabase.Refresh(ImportAssetOptions.ForceUpdate); |
| | | |
| | |
| | | UpdateLuaSetting.SetAllLuaAssetBundleName(); |
| | | ExcuteBuildAsset("lua"); |
| | | LuaBuildHelper.OnPostBuild(); |
| | | } |
| | | |
| | | private void ExcuteBuildPatch() |
| | | { |
| | | string sourcePath; |
| | | if (m_UserData.m_BuildTarget == ValidBuildTarget.Android) |
| | | { |
| | | IFixEditor.CompileToAndroid(); |
| | | sourcePath = ResourcesPath.PATCH_ANDROID; |
| | | } |
| | | else if (m_UserData.m_BuildTarget == ValidBuildTarget.iOS) |
| | | { |
| | | IFixEditor.CompileToIOS(); |
| | | sourcePath = ResourcesPath.PATCH_IOS; |
| | | } |
| | | else |
| | | { |
| | | IFixEditor.Patch(); |
| | | sourcePath = ResourcesPath.PATCH_EDITOR; |
| | | } |
| | | var outputPath = Application.dataPath.Replace("Assets", m_UserData.m_OutputPath); |
| | | outputPath = StringUtility.Contact(outputPath, "/patch"); |
| | | if (Directory.Exists(outputPath)) |
| | | Directory.Delete(outputPath, true); |
| | | DirectoryCopy(sourcePath, outputPath, ".meta"); |
| | | } |
| | | |
| | | private void ExcuteBuildLevels() |
| | |
| | | } |
| | | } |
| | | |
| | | private static void DirectoryCopy(string sourceDirName, string destDirName) |
| | | private static void DirectoryCopy(string sourceDirName, string destDirName, string excludeEx = null) |
| | | { |
| | | // Get the subdirectories for the specified directory. |
| | | DirectoryInfo dir = new DirectoryInfo(sourceDirName); |
| | |
| | | foreach (FileInfo file in files) |
| | | { |
| | | string temppath = Path.Combine(destDirName, file.Name); |
| | | file.CopyTo(temppath, false); |
| | | if (excludeEx == null || file.Extension != excludeEx) |
| | | file.CopyTo(temppath, false); |
| | | } |
| | | |
| | | DirectoryInfo[] dirs = dir.GetDirectories(); |