| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263 | 
							- using System.IO;
 
- using HybridCLR.Editor;
 
- using UnityEditor;
 
- using UnityEngine;
 
- using GFGGame;
 
- using HybridCLR.Editor.Commands;
 
- namespace GFGEditor
 
- {
 
-     public class BuildDllHelper
 
-     {
 
-         public static void BuildHotUpdateDll()
 
-         {
 
-             CompileDllCommand.CompileDllActiveBuildTarget();
 
-             CopyHotUpdateAssembliesToStreamingAssets();
 
-         }
 
-         public static void CopyHotUpdateAssembliesToStreamingAssets()
 
-         {
 
-             var target = EditorUserBuildSettings.activeBuildTarget;
 
-             string hotfixDllSrcDir = SettingsUtil.GetHotUpdateDllsOutputDirByTarget(target);
 
-             string hotfixAssembliesDstDir = LauncherConfig.DllDirHotfix;
 
-             if (!Directory.Exists(LauncherConfig.DllDirHotfix))
 
-             {
 
-                 Directory.CreateDirectory(LauncherConfig.DllDirHotfix);
 
-             }
 
-             foreach (var dll in SettingsUtil.HotUpdateAssemblyFiles)
 
-             {
 
-                 string dllPath = $"{hotfixDllSrcDir}/{dll}";
 
-                 string dllBytesPath = $"{hotfixAssembliesDstDir}{dll}.bytes";
 
-                 File.Copy(dllPath, dllBytesPath, true);
 
-                 Debug.Log($"[CopyHotUpdateAssembliesToStreamingAssets] copy hotfix dll {dllPath} -> {dllBytesPath}");
 
-             }
 
-         }
 
-         public static void CopyAOTAssembliesToStreamingAssets()
 
-         {
 
-             var target = EditorUserBuildSettings.activeBuildTarget;
 
-             string aotAssembliesSrcDir = SettingsUtil.GetAssembliesPostIl2CppStripDir(target);
 
-             string aotAssembliesDstDir = LauncherConfig.DllDirAOT;
 
-             if(!Directory.Exists(LauncherConfig.DllDirAOT))
 
-             {
 
-                 Directory.CreateDirectory(LauncherConfig.DllDirAOT);
 
-             }
 
-             foreach (var dll in HotUpdateCodeLoader.AOTMetaAssemblyNames)
 
-             {
 
-                 string srcDllPath = $"{aotAssembliesSrcDir}/{dll}";
 
-                 if (!File.Exists(srcDllPath))
 
-                 {
 
-                     Debug.LogError($"ab中添加AOT补充元数据dll:{srcDllPath} 时发生错误,文件不存在。裁剪后的AOT dll在BuildPlayer时才能生成,因此需要你先构建一次游戏App后再打包。");
 
-                     continue;
 
-                 }
 
-                 string dllBytesPath = $"{aotAssembliesDstDir}{dll}.bytes";
 
-                 File.Copy(srcDllPath, dllBytesPath, true);
 
-                 Debug.Log($"[CopyAOTAssembliesToStreamingAssets] copy AOT dll {srcDllPath} -> {dllBytesPath}");
 
-             }
 
-         }
 
-     }
 
- }
 
 
  |