111
This commit is contained in:
@@ -2,58 +2,60 @@ using UnityEditor;
|
||||
using UnityEngine;
|
||||
using System.IO;
|
||||
|
||||
|
||||
public class CopyHotDll
|
||||
namespace Tuan.GameFramework
|
||||
{
|
||||
[MenuItem("Tools/更新生成PreloadDll")]
|
||||
public static void CopyPreloadDll2Byte()
|
||||
public class CopyHotDll
|
||||
{
|
||||
HybridCLR.Editor.Commands.CompileDllCommand.CompileDllActiveBuildTarget();
|
||||
string sourceDir = $"{Application.dataPath.Replace("/Assets", "")}/HybridCLRData/HotUpdateDlls/{UnityEditor.EditorUserBuildSettings.activeBuildTarget}/GameScripts.Preload.dll";
|
||||
string destDir = $"{Application.dataPath}/GameRes/Preload/HotUpdateDll/GameScripts.Preload.bytes";
|
||||
if (File.Exists(destDir))
|
||||
[MenuItem("Tools/更新生成PreloadDll")]
|
||||
public static void CopyPreloadDll2Byte()
|
||||
{
|
||||
File.Delete(destDir);
|
||||
}
|
||||
File.Copy(sourceDir, destDir);
|
||||
AssetDatabase.Refresh();
|
||||
Debug.Log($"copy {sourceDir} to {destDir}");
|
||||
}
|
||||
[MenuItem("Tools/更新生成MainDll")]
|
||||
public static void CopyMainDll2Byte()
|
||||
{
|
||||
HybridCLR.Editor.Commands.CompileDllCommand.CompileDllActiveBuildTarget();
|
||||
string sourceDir = $"{Application.dataPath.Replace("/Assets", "")}/HybridCLRData/HotUpdateDlls/{UnityEditor.EditorUserBuildSettings.activeBuildTarget}/GameScripts.Main.dll";
|
||||
string destDir = $"{Application.dataPath}/GameRes/Main/HotUpdateDll/GameScripts.Main.bytes";
|
||||
if (File.Exists(destDir))
|
||||
{
|
||||
File.Delete(destDir);
|
||||
}
|
||||
File.Copy(sourceDir, destDir);
|
||||
AssetDatabase.Refresh();
|
||||
Debug.Log($"copy {sourceDir} to {destDir}");
|
||||
}
|
||||
[MenuItem("Tools/更新生成补充数据源")]
|
||||
public static void CopyDepDll2Byte()
|
||||
{
|
||||
HybridCLR.Editor.Commands.CompileDllCommand.CompileDllActiveBuildTarget();
|
||||
string sourceDir = $"{Application.dataPath.Replace("/Assets", "")}/HybridCLRData/AssembliesPostIl2CppStrip/{UnityEditor.EditorUserBuildSettings.activeBuildTarget}/";
|
||||
string destDir = $"{Application.dataPath}/GameRes/Main/HotUpdateDll/";
|
||||
foreach (string dll in HotDllLoader.Inst.DepDlls)
|
||||
{
|
||||
string sourcePath = $"{sourceDir}/{dll}";
|
||||
string destPath = $"{destDir}/{dll}.bytes";
|
||||
if (File.Exists(sourcePath))
|
||||
HybridCLR.Editor.Commands.CompileDllCommand.CompileDllActiveBuildTarget();
|
||||
string sourceDir = $"{Application.dataPath.Replace("/Assets", "")}/HybridCLRData/HotUpdateDlls/{UnityEditor.EditorUserBuildSettings.activeBuildTarget}/GameScripts.Preload.dll";
|
||||
string destDir = $"{Application.dataPath}/GameRes/Preload/HotUpdateDll/GameScripts.Preload.bytes";
|
||||
if (File.Exists(destDir))
|
||||
{
|
||||
if (File.Exists(destPath))
|
||||
{
|
||||
File.Delete(destPath);
|
||||
}
|
||||
File.Copy(sourcePath, destPath);
|
||||
AssetDatabase.Refresh();
|
||||
Debug.Log($"copy {sourcePath} to {destPath}");
|
||||
File.Delete(destDir);
|
||||
}
|
||||
File.Copy(sourceDir, destDir);
|
||||
AssetDatabase.Refresh();
|
||||
Debug.Log($"copy {sourceDir} to {destDir}");
|
||||
}
|
||||
[MenuItem("Tools/更新生成MainDll")]
|
||||
public static void CopyMainDll2Byte()
|
||||
{
|
||||
HybridCLR.Editor.Commands.CompileDllCommand.CompileDllActiveBuildTarget();
|
||||
string sourceDir = $"{Application.dataPath.Replace("/Assets", "")}/HybridCLRData/HotUpdateDlls/{UnityEditor.EditorUserBuildSettings.activeBuildTarget}/GameScripts.Main.dll";
|
||||
string destDir = $"{Application.dataPath}/GameRes/Main/HotUpdateDll/GameScripts.Main.bytes";
|
||||
if (File.Exists(destDir))
|
||||
{
|
||||
File.Delete(destDir);
|
||||
}
|
||||
File.Copy(sourceDir, destDir);
|
||||
AssetDatabase.Refresh();
|
||||
Debug.Log($"copy {sourceDir} to {destDir}");
|
||||
}
|
||||
[MenuItem("Tools/更新生成补充数据源")]
|
||||
public static void CopyDepDll2Byte()
|
||||
{
|
||||
HybridCLR.Editor.Commands.CompileDllCommand.CompileDllActiveBuildTarget();
|
||||
string sourceDir = $"{Application.dataPath.Replace("/Assets", "")}/HybridCLRData/AssembliesPostIl2CppStrip/{UnityEditor.EditorUserBuildSettings.activeBuildTarget}/";
|
||||
string destDir = $"{Application.dataPath}/GameRes/Main/HotUpdateDll/";
|
||||
foreach (string dll in HotDllLoader.Inst.DepDlls)
|
||||
{
|
||||
string sourcePath = $"{sourceDir}/{dll}";
|
||||
string destPath = $"{destDir}/{dll}.bytes";
|
||||
if (File.Exists(sourcePath))
|
||||
{
|
||||
if (File.Exists(destPath))
|
||||
{
|
||||
File.Delete(destPath);
|
||||
}
|
||||
File.Copy(sourcePath, destPath);
|
||||
AssetDatabase.Refresh();
|
||||
Debug.Log($"copy {sourcePath} to {destPath}");
|
||||
}
|
||||
}
|
||||
Debug.Log("copy over");
|
||||
}
|
||||
Debug.Log("copy over");
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user