Files

33 lines
1.0 KiB
C#
Raw Permalink Normal View History

2025-10-31 15:31:34 +08:00
using System.Collections;
using System.Collections.Generic;
using UnityEditor;
using UnityEngine;
using System;
using System.IO;
using System.Text;
public class CopyHotDll
{
[MenuItem("Tools/<2F><><EFBFBD><EFBFBD><EFBFBD>ȸ<EFBFBD>Dll<6C><6C><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD>")]
public static void CreateDllByte()
{
HybridCLR.Editor.Commands.CompileDllCommand.CompileDllActiveBuildTarget();
BuildTarget buildTarget = UnityEditor.EditorUserBuildSettings.activeBuildTarget;
foreach (var dll in Boot.Inst.dllMap)
{
string sourcePath = dll.Value == 0 ?
$"{KeyManager.TDllSourceDir}/{buildTarget}/{dll.Key}.dll" :
$"{KeyManager.HotDllSourceDir}/{buildTarget}/{dll.Key}.dll";
string destPath = $"{KeyManager.AssetDllDir}/{dll.Key}.dll.bytes";
if (File.Exists(destPath))
File.Delete(destPath);
File.Copy(sourcePath, destPath);
AssetDatabase.Refresh();
Debug.Log($"copy {sourcePath} to {destPath}");
}
Debug.Log($"<22><><EFBFBD><EFBFBD><EFBFBD>ȸ<EFBFBD>Dll<6C><6C><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD><C4BC><EFBFBD><EFBFBD><EFBFBD>");
}
}