29 lines
909 B
C#
29 lines
909 B
C#
using System.IO;
|
|
using UnityEditor;
|
|
using UnityEngine;
|
|
|
|
namespace ProjectBuilder
|
|
{
|
|
public class NoWindowFunctions
|
|
{
|
|
[MenuItem("Tools/文件与路径/转换为Dll")]
|
|
public static void CovertToDll()
|
|
{
|
|
var dllPath = Application.dataPath + "/../Library/ScriptAssemblies/GamePlay.dll";
|
|
//Assets/Code/Scripts/Gameplay
|
|
var codePath = Application.dataPath + "/Code/Scripts/Gameplay";
|
|
|
|
// 删除Code/Scripts/Gameplay下的所有文件
|
|
var directoryInfo = new System.IO.DirectoryInfo(codePath);
|
|
directoryInfo.Delete(true);
|
|
|
|
// 复制GamePlay.dll到Code/Scripts/Gameplay
|
|
Directory.CreateDirectory(codePath);
|
|
File.Copy(dllPath, codePath + "/GamePlay.dll", true);
|
|
|
|
// 刷新
|
|
AssetDatabase.Refresh();
|
|
}
|
|
}
|
|
}
|