33 lines
1.0 KiB
C#
33 lines
1.0 KiB
C#
|
|
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>");
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
}
|