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