提交 b9071f9a 编写于 作者: T tanghai

兼容rider跟vs的pdb文件路径

上级 b4992569
using System.Diagnostics;
using System;
using System.IO;
using ETModel;
using UnityEditor;
......@@ -9,7 +9,6 @@ namespace ETEditor
public class Startup
{
private const string ScriptAssembliesDir = "Library/ScriptAssemblies";
private const string DebugDir = "Temp/UnityVS_bin/Debug";
private const string CodeDir = "Assets/Res/Code/";
private const string HotfixDll = "Unity.Hotfix.dll";
private const string HotfixPdb = "Unity.Hotfix.pdb";
......@@ -17,24 +16,32 @@ namespace ETEditor
static Startup()
{
string batPath = $"Tools{Path.DirectorySeparatorChar}pdb2mdb.exe";
ProcessStartInfo info = new ProcessStartInfo
// Copy最新的pdb文件
string[] pdbDirs =
{
FileName = batPath,
WindowStyle = ProcessWindowStyle.Hidden,
ErrorDialog = true,
UseShellExecute = true,
Arguments = Path.Combine(ScriptAssembliesDir, HotfixDll)
"Temp/UnityVS_bin/Debug",
"Temp/UnityVS_bin/Release",
"Temp/Debug",
"Temp/Release"
};
Process p = Process.Start ( info );
p.WaitForExit ();
if (File.Exists(Path.Combine(DebugDir, HotfixPdb)))
DateTime dateTime = DateTime.MinValue;
string newestPdb = "";
foreach (string pdbDir in pdbDirs)
{
string pdbPath = Path.Combine(pdbDir, HotfixPdb);
FileInfo fi = new FileInfo(pdbPath);
DateTime lastWriteTimeUtc = fi.LastWriteTimeUtc;
if (lastWriteTimeUtc > dateTime)
{
newestPdb = pdbPath;
dateTime = lastWriteTimeUtc;
}
}
if (newestPdb != "")
{
File.Copy(Path.Combine(DebugDir, HotfixPdb), Path.Combine(CodeDir, "Hotfix.pdb.bytes"), true);
File.Copy(Path.Combine(newestPdb), Path.Combine(CodeDir, "Hotfix.pdb.bytes"), true);
Log.Info($"复制Hotfix.pdb到Res/Code完成");
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册