NLDClient-yudde/ProjectNLD/Assets/Editor/ProjectBuilder/NoWindowFunctions.cs

40 lines
1.2 KiB
C#
Raw Normal View History

2025-04-29 17:49:20 +08:00
using System.IO;
using UnityEditor;
using UnityEngine;
namespace ProjectBuilder
{
public class NoWindowFunctions
{
2025-04-30 16:44:31 +08:00
[MenuItem("Tools/文件与路径/转换为Dll _F1")]
2025-04-29 17:49:20 +08:00
public static void CovertToDll()
{
2025-04-29 17:54:49 +08:00
if (Application.isPlaying)
{
Debug.LogError("不能在运行时转换为Dll");
return;
}
2025-04-29 17:49:20 +08:00
var dllPath = Application.dataPath + "/../Library/ScriptAssemblies/GamePlay.dll";
2025-04-30 16:43:06 +08:00
//Assets/Code/Scripts/GamePlay_Dll
var codePath = Application.dataPath + "/Code/Scripts/GamePlay_Dll";
2025-04-29 17:54:49 +08:00
var targetDllPath = codePath + "/GamePlay.dll";
2025-04-30 16:43:06 +08:00
2025-04-29 17:49:20 +08:00
// 复制GamePlay.dll到Code/Scripts/Gameplay
Directory.CreateDirectory(codePath);
2025-04-30 16:43:06 +08:00
File.Copy(dllPath, targetDllPath, true);
2025-04-29 17:49:20 +08:00
// 刷新
AssetDatabase.Refresh();
2025-04-30 16:44:31 +08:00
Debug.Log("转换为Dll成功");
2025-04-29 17:49:20 +08:00
}
2025-05-28 16:31:32 +08:00
[MenuItem("Tools/文件与路径/打开战斗日志文件夹")]
public static void OpenFightLogFile()
{
var logFilePath = Application.persistentDataPath + "/";
EditorUtility.RevealInFinder(logFilePath);
}
2025-04-29 17:49:20 +08:00
}
}