AkiraPixelWind/Assets/Scripts/Editor/ProjectTools/ProjectTool.cs

472 lines
17 KiB
C#
Raw Normal View History

2022-12-29 18:20:40 +08:00
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Runtime.InteropServices;
using UnityEditor;
using UnityEngine;
using UnityEngine.UI;
// <20><><EFBFBD><EFBFBD>
public class ProjectTool
{
#if UNITY_EDITOR
///<summary>
/// <20>ú<EFBFBD><C3BA><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɲ<EFBFBD>ͬ<EFBFBD>̲߳<DFB3><CCB2><EFBFBD><EFBFBD>Ĵ<EFBFBD><C4B4>ڵ<EFBFBD><DAB5><EFBFBD>ʾ״̬
/// </summary>
/// <param name="hWnd"><3E><><EFBFBD>ھ<EFBFBD><DABE><EFBFBD></param>
/// <param name="cmdShow">ָ<><D6B8><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʾ<EFBFBD><CABE><EFBFBD><EFBFBD><E9BFB4><EFBFBD><EFBFBD>ֵ<EFBFBD>б<EFBFBD><D0B1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ShowWlndow<6F><77><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˵<EFBFBD><CBB5><EFBFBD><EFBFBD><EFBFBD><EFBFBD></param>
/// <returns><3E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ԭ<EFBFBD><D4AD><EFBFBD>ɼ<EFBFBD><C9BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֵΪ<D6B5><CEAA><EFBFBD><EFBFBD><E3A3BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ԭ<EFBFBD><D4AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>أ<EFBFBD><D8A3><EFBFBD><EFBFBD><EFBFBD>ֵΪ<D6B5><CEAA></returns>
[DllImport("User32.dll")]
private static extern bool ShowWindowAsync(IntPtr hWnd, int cmdShow);
/// <summary>
/// <20>ú<EFBFBD><C3BA><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ָ<EFBFBD><D6B8><EFBFBD><EFBFBD><EFBFBD>ڵ<EFBFBD><DAB5>߳<EFBFBD><DFB3><EFBFBD><EFBFBD>õ<EFBFBD>ǰ̨<C7B0><CCA8><EFBFBD><EFBFBD><EFBFBD>Ҽ<EFBFBD><D2BC><EFBFBD><EFBFBD>ô<EFBFBD><C3B4>ڡ<EFBFBD><DAA1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ת<EFBFBD><D7AA><EFBFBD>ô<EFBFBD><C3B4>ڣ<EFBFBD><DAA3><EFBFBD>Ϊ<EFBFBD>û<EFBFBD><C3BB>ĸ<EFBFBD><C4B8>ֿ<EFBFBD><D6BF>ӵļǺš<C7BA>
/// ϵͳ<CFB5><CDB3><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ǰ̨<C7B0><CCA8><EFBFBD>ڵ<EFBFBD><DAB5>̷߳<DFB3><CCB7><EFBFBD><EFBFBD><EFBFBD>Ȩ<EFBFBD><C8A8><EFBFBD>Ը<EFBFBD><D4B8><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>̡߳<DFB3>
/// </summary>
/// <param name="hWnd"><3E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EEB2A2><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ǰ̨<C7B0>Ĵ<EFBFBD><C4B4>ھ<EFBFBD><DABE><EFBFBD></param>
/// <returns><3E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ǰ̨<C7B0><CCA8><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֵΪ<D6B5><CEAA><EFBFBD><EFBFBD><E3A3BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>δ<EFBFBD><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ǰ̨<C7B0><CCA8><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֵΪ<D6B5><CEAA></returns>
[DllImport("User32.dll")]
private static extern bool SetForegroundWindow(IntPtr hWnd);
static string ProjectPath => System.Environment.CurrentDirectory;
static string AssetsPath => ProjectPath + "\\Assets\\";
static string LubanToolsPath => ProjectPath + "\\LubanTools\\";
static string GameAssetsPath => AssetsPath + "GameAssets\\";
static string LubanToolsDesignerConfigsPath => LubanToolsPath + "DesignerConfigs\\";
[MenuItem("<22><>Ŀ<EFBFBD><C4BF><EFBFBD><EFBFBD>/<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>/<2F><><EFBFBD><EFBFBD><EFBFBD>߻<EFBFBD><DFBB><EFBFBD><EFBFBD>ú<EFBFBD><C3BA><EFBFBD><EFBFBD><EFBFBD>")]
static void CopyBuildCfg()
{
System.Diagnostics.Process proc = new System.Diagnostics.Process();
proc.StartInfo.FileName = LubanToolsPath + "gen_code_bin.bat";
//proc.StartInfo.Arguments = string.Format("10");//this is argument
//proc.StartInfo.UseShellExecute = false;//<2F><><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD><EFBFBD>dos<6F><73><EFBFBD><EFBFBD>
//proc.StartInfo.CreateNoWindow = false;//<2F><><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD><EFBFBD>dos<6F><73><EFBFBD><EFBFBD>
proc.StartInfo.WorkingDirectory = LubanToolsPath;
//proc.StartInfo.Verb = "runas";//<2F><><EFBFBD>ø<EFBFBD><C3B8><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Թ<EFBFBD><D4B9><EFBFBD>ԱȨ<D4B1><C8A8><EFBFBD><EFBFBD><EFBFBD>н<EFBFBD><D0BD><EFBFBD>
proc.Start();
//proc.WaitForExit();
HandleRunningInstance(proc);
}
[MenuItem("<22><>Ŀ<EFBFBD><C4BF><EFBFBD><EFBFBD>/<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>/<2F><><EFBFBD><EFBFBD><EFBFBD>߻<EFBFBD><DFBB><EFBFBD><EFBFBD>ú<EFBFBD><C3BA><EFBFBD><EFBFBD><EFBFBD>(<28><><EFBFBD><EFBFBD>)")]
static void CopyBuildCfg_Test()
{
System.Diagnostics.Process proc = new System.Diagnostics.Process();
proc.StartInfo.FileName = LubanToolsPath + "gen_code_bin - <20><><EFBFBD><EFBFBD>.bat";
//proc.StartInfo.Arguments = string.Format("10");//this is argument
//proc.StartInfo.UseShellExecute = false;//<2F><><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD><EFBFBD>dos<6F><73><EFBFBD><EFBFBD>
//proc.StartInfo.CreateNoWindow = false;//<2F><><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD><EFBFBD>dos<6F><73><EFBFBD><EFBFBD>
proc.StartInfo.WorkingDirectory = LubanToolsPath;
//proc.StartInfo.Verb = "runas";//<2F><><EFBFBD>ø<EFBFBD><C3B8><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Թ<EFBFBD><D4B9><EFBFBD>ԱȨ<D4B1><C8A8><EFBFBD><EFBFBD><EFBFBD>н<EFBFBD><D0BD><EFBFBD>
proc.Start();
//proc.WaitForExit();
HandleRunningInstance(proc);
}
[MenuItem("<22><>Ŀ<EFBFBD><C4BF><EFBFBD><EFBFBD>/Protobuff<66><66><EFBFBD><EFBFBD>/<2F><><EFBFBD><EFBFBD>Protobuff CS<43>ļ<EFBFBD>")]
static void SVNBuildProtobuffCS()
{
string exepath = LubanToolsPath;
if (!File.Exists(exepath + "/copy_Path.txt"))
{
Console.WriteLine("copy_Path <20><><EFBFBD>ò<EFBFBD><C3B2><EFBFBD><EFBFBD><EFBFBD>");
return;
}
string ProtoBuffDir = "";
string SvnDir = "";
string[] pathcfg = File.ReadAllText(exepath + "/copy_Path.txt").Split('\n'); ;
foreach (var pc in pathcfg)
{
var parr = pc.Split('=');
if (parr[0].Trim() == "ProtoBuffDir") ProtoBuffDir = parr[1].Trim();
if (parr[0].Trim() == "SvnDir") SvnDir = parr[1].Trim();
}
if (string.IsNullOrEmpty(SvnDir))
{
Debug.LogError("<22><><EFBFBD><EFBFBD>lubanĿ¼copy_Path.txt<78><74><EFBFBD><EFBFBD><EFBFBD><EFBFBD>SVN<56><4E>װĿ¼bin<69>ļ<EFBFBD><C4BC><EFBFBD>,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD>SvnDir=C:\\Program Files\\TortoiseSVN\\bin");
return;
}
if (string.IsNullOrEmpty(ProtoBuffDir))
{
Debug.LogError("<22><><EFBFBD><EFBFBD>lubanĿ¼copy_Path.txt<78><74><EFBFBD><EFBFBD><EFBFBD><EFBFBD>SVN<56><4E>װĿ¼bin<69>ļ<EFBFBD><C4BC><EFBFBD>,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,ProtoBuffDir=D:\\Project\\proto");
return;
}
System.Diagnostics.Process proc = new System.Diagnostics.Process();
proc.StartInfo.FileName = ProtoBuffDir + "/build_cs.bat";
//proc.StartInfo.Arguments = string.Format("10");//this is argument
//proc.StartInfo.UseShellExecute = false;//<2F><><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD><EFBFBD>dos<6F><73><EFBFBD><EFBFBD>
//proc.StartInfo.CreateNoWindow = false;//<2F><><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD><EFBFBD>dos<6F><73><EFBFBD><EFBFBD>
proc.StartInfo.WorkingDirectory = ProtoBuffDir;
//proc.StartInfo.Verb = "runas";//<2F><><EFBFBD>ø<EFBFBD><C3B8><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Թ<EFBFBD><D4B9><EFBFBD>ԱȨ<D4B1><C8A8><EFBFBD><EFBFBD><EFBFBD>н<EFBFBD><D0BD><EFBFBD>
proc.Start();
//proc.WaitForExit();
HandleRunningInstance(proc);
}
[MenuItem("<22><>Ŀ<EFBFBD><C4BF><EFBFBD><EFBFBD>/<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>/<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ñ<EFBFBD><C3B1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD>")]
static void Opencopy_NameCfg()
{
string exepath = LubanToolsPath;
if (!File.Exists(exepath + "/copy_NameCfg.txt"))
{
Console.WriteLine("copy_Path <20><><EFBFBD>ò<EFBFBD><C3B2><EFBFBD><EFBFBD><EFBFBD>");
return;
}
System.Diagnostics.Process proc = new System.Diagnostics.Process();
proc.StartInfo.FileName = exepath + "/copy_NameCfg.txt";
//proc.StartInfo.Arguments = string.Format("10");//this is argument
//proc.StartInfo.UseShellExecute = false;//<2F><><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD><EFBFBD>dos<6F><73><EFBFBD><EFBFBD>
//proc.StartInfo.CreateNoWindow = false;//<2F><><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD><EFBFBD>dos<6F><73><EFBFBD><EFBFBD>
proc.StartInfo.WorkingDirectory = LubanToolsPath;
//proc.StartInfo.Verb = "runas";//<2F><><EFBFBD>ø<EFBFBD><C3B8><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Թ<EFBFBD><D4B9><EFBFBD>ԱȨ<D4B1><C8A8><EFBFBD><EFBFBD><EFBFBD>н<EFBFBD><D0BD><EFBFBD>
proc.Start();
//proc.WaitForExit();
HandleRunningInstance(proc);
}
[MenuItem("<22><>Ŀ<EFBFBD><C4BF><EFBFBD><EFBFBD>/<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>/<2F>򿪿<EFBFBD><F2BFAABF><EFBFBD>·<EFBFBD><C2B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD>")]
static void Opencopy_Path()
{
string exepath = LubanToolsPath;
if (!File.Exists(exepath + "/copy_Path.txt"))
{
Console.WriteLine("copy_Path <20><><EFBFBD>ò<EFBFBD><C3B2><EFBFBD><EFBFBD><EFBFBD>");
return;
}
System.Diagnostics.Process proc = new System.Diagnostics.Process();
proc.StartInfo.FileName = exepath + "/copy_Path.txt";
//proc.StartInfo.Arguments = string.Format("10");//this is argument
//proc.StartInfo.UseShellExecute = false;//<2F><><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD><EFBFBD>dos<6F><73><EFBFBD><EFBFBD>
//proc.StartInfo.CreateNoWindow = false;//<2F><><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD><EFBFBD>dos<6F><73><EFBFBD><EFBFBD>
proc.StartInfo.WorkingDirectory = LubanToolsPath;
//proc.StartInfo.Verb = "runas";//<2F><><EFBFBD>ø<EFBFBD><C3B8><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Թ<EFBFBD><D4B9><EFBFBD>ԱȨ<D4B1><C8A8><EFBFBD><EFBFBD><EFBFBD>н<EFBFBD><D0BD><EFBFBD>
proc.Start();
//proc.WaitForExit();
HandleRunningInstance(proc);
}
[MenuItem("<22><>Ŀ<EFBFBD><C4BF><EFBFBD><EFBFBD>/SVN<56><4E><EFBFBD><EFBFBD>/AssetsĿ¼")]
static void SVNUpdateAssets()
{
string exepath = LubanToolsPath;
if (!File.Exists(exepath + "/copy_Path.txt"))
{
Console.WriteLine("copy_Path <20><><EFBFBD>ò<EFBFBD><C3B2><EFBFBD><EFBFBD><EFBFBD>");
return;
}
string SrcDir = "";
string SvnDir = "";
string LubanDir = "";
string[] pathcfg = File.ReadAllText(exepath + "/copy_Path.txt").Split('\n'); ;
foreach (var pc in pathcfg)
{
var parr = pc.Split('=');
if (parr[0].Trim() == "SrcDir") SrcDir = parr[1].Trim();
if (parr[0].Trim() == "LubanDir") LubanDir = parr[1].Trim();
if (parr[0].Trim() == "SvnDir") SvnDir = parr[1].Trim();
}
if (string.IsNullOrEmpty(SvnDir))
{
Debug.LogError("<22><><EFBFBD><EFBFBD>lubanĿ¼copy_Path.txt<78><74><EFBFBD><EFBFBD><EFBFBD><EFBFBD>SVN<56><4E>װĿ¼bin<69>ļ<EFBFBD><C4BC><EFBFBD>,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD>SvnDir=C:\\Program Files\\TortoiseSVN\\bin");
return;
}
System.Diagnostics.Process p = new System.Diagnostics.Process();
p.StartInfo.FileName = SvnDir + "//TortoiseProc.exe";
p.StartInfo.Arguments = " /command:update /path:" + AssetsPath;
p.Start();
}
[MenuItem("<22><>Ŀ<EFBFBD><C4BF><EFBFBD><EFBFBD>/SVN<56><4E><EFBFBD><EFBFBD>/LubanĿ¼")]
static void SVNUpdateLuban()
{
string exepath = LubanToolsPath;
if (!File.Exists(exepath + "/copy_Path.txt"))
{
Console.WriteLine("copy_Path <20><><EFBFBD>ò<EFBFBD><C3B2><EFBFBD><EFBFBD><EFBFBD>");
return;
}
string SrcDir = "";
string SvnDir = "";
string LubanDir = "";
string[] pathcfg = File.ReadAllText(exepath + "/copy_Path.txt").Split('\n'); ;
foreach (var pc in pathcfg)
{
var parr = pc.Split('=');
if (parr[0].Trim() == "SrcDir") SrcDir = parr[1].Trim();
if (parr[0].Trim() == "LubanDir") LubanDir = parr[1].Trim();
if (parr[0].Trim() == "SvnDir") SvnDir = parr[1].Trim();
}
if (string.IsNullOrEmpty(SvnDir))
{
Debug.LogError("<22><><EFBFBD><EFBFBD>lubanĿ¼copy_Path.txt<78><74><EFBFBD><EFBFBD><EFBFBD><EFBFBD>SVN<56><4E>װĿ¼bin<69>ļ<EFBFBD><C4BC><EFBFBD>,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD>SvnDir=C:\\Program Files\\TortoiseSVN\\bin");
return;
}
System.Diagnostics.Process p = new System.Diagnostics.Process();
p.StartInfo.FileName = SvnDir + "//TortoiseProc.exe";
p.StartInfo.Arguments = " /command:update /path:" + LubanToolsPath;
p.Start();
}
[MenuItem("<22><>Ŀ<EFBFBD><C4BF><EFBFBD><EFBFBD>/SVN<56><4E><EFBFBD><EFBFBD>/<2F>߻<EFBFBD>Ŀ¼")]
static void SVNUpdatePlanning()
{
string exepath = LubanToolsPath;
if (!File.Exists(exepath + "/copy_Path.txt"))
{
Console.WriteLine("copy_Path <20><><EFBFBD>ò<EFBFBD><C3B2><EFBFBD><EFBFBD><EFBFBD>");
return;
}
string SrcDir = "";
string SvnDir = "";
string LubanDir = "";
string[] pathcfg = File.ReadAllText(exepath + "/copy_Path.txt").Split('\n'); ;
foreach (var pc in pathcfg)
{
var parr = pc.Split('=');
if (parr[0].Trim() == "SrcDir") SrcDir = parr[1].Trim();
if (parr[0].Trim() == "LubanDir") LubanDir = parr[1].Trim();
if (parr[0].Trim() == "SvnDir") SvnDir = parr[1].Trim();
}
if (string.IsNullOrEmpty(SvnDir))
{
Debug.LogError("<22><><EFBFBD><EFBFBD>lubanĿ¼copy_Path.txt<78><74><EFBFBD><EFBFBD><EFBFBD><EFBFBD>SVN<56><4E>װĿ¼bin<69>ļ<EFBFBD><C4BC><EFBFBD>,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD>SvnDir=C:\\Program Files\\TortoiseSVN\\bin");
return;
}
System.Diagnostics.Process p = new System.Diagnostics.Process();
p.StartInfo.FileName = SvnDir + "//TortoiseProc.exe";
p.StartInfo.Arguments = " /command:update /path:" + SrcDir;
p.Start();
}
[MenuItem("<22><>Ŀ<EFBFBD><C4BF><EFBFBD><EFBFBD>/SVN<56><4E><EFBFBD><EFBFBD>/Protobuff")]
static void SVNUpdateProtobuff()
{
string exepath = LubanToolsPath;
if (!File.Exists(exepath + "/copy_Path.txt"))
{
Console.WriteLine("copy_Path <20><><EFBFBD>ò<EFBFBD><C3B2><EFBFBD><EFBFBD><EFBFBD>");
return;
}
string ProtoBuffDir = "";
string SvnDir = "";
string[] pathcfg = File.ReadAllText(exepath + "/copy_Path.txt").Split('\n'); ;
foreach (var pc in pathcfg)
{
var parr = pc.Split('=');
if (parr[0].Trim() == "ProtoBuffDir") ProtoBuffDir = parr[1].Trim();
if (parr[0].Trim() == "SvnDir") SvnDir = parr[1].Trim();
}
if (string.IsNullOrEmpty(SvnDir))
{
Debug.LogError("<22><><EFBFBD><EFBFBD>lubanĿ¼copy_Path.txt<78><74><EFBFBD><EFBFBD><EFBFBD><EFBFBD>SVN<56><4E>װĿ¼bin<69>ļ<EFBFBD><C4BC><EFBFBD>,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD>SvnDir=C:\\Program Files\\TortoiseSVN\\bin");
return;
}
if (string.IsNullOrEmpty(ProtoBuffDir))
{
Debug.LogError("<22><><EFBFBD><EFBFBD>lubanĿ¼copy_Path.txt<78><74><EFBFBD><EFBFBD><EFBFBD><EFBFBD>SVN<56><4E>װĿ¼bin<69>ļ<EFBFBD><C4BC><EFBFBD>,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,ProtoBuffDir=D:\\Project\\proto");
return;
}
System.Diagnostics.Process p = new System.Diagnostics.Process();
p.StartInfo.FileName = SvnDir + "//TortoiseProc.exe";
p.StartInfo.Arguments = " /command:update /path:" + ProtoBuffDir;
p.Start();
}
[MenuItem("<22><>Ŀ<EFBFBD><C4BF><EFBFBD><EFBFBD>/SVN<56>ύ/AssetsĿ¼")]
static void SVNCommitAssets()
{
string exepath = LubanToolsPath;
if (!File.Exists(exepath + "/copy_Path.txt"))
{
Console.WriteLine("copy_Path <20><><EFBFBD>ò<EFBFBD><C3B2><EFBFBD><EFBFBD><EFBFBD>");
return;
}
string SrcDir = "";
string SvnDir = "";
string LubanDir = "";
string[] pathcfg = File.ReadAllText(exepath + "/copy_Path.txt").Split('\n'); ;
foreach (var pc in pathcfg)
{
var parr = pc.Split('=');
if (parr[0].Trim() == "SrcDir") SrcDir = parr[1].Trim();
if (parr[0].Trim() == "LubanDir") LubanDir = parr[1].Trim();
if (parr[0].Trim() == "SvnDir") SvnDir = parr[1].Trim();
}
if (string.IsNullOrEmpty(SvnDir))
{
Debug.LogError("<22><><EFBFBD><EFBFBD>lubanĿ¼copy_Path.txt<78><74><EFBFBD><EFBFBD><EFBFBD><EFBFBD>SVN<56><4E>װĿ¼bin<69>ļ<EFBFBD><C4BC><EFBFBD>,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD>SvnDir=C:\\Program Files\\TortoiseSVN\\bin");
return;
}
System.Diagnostics.Process p = new System.Diagnostics.Process();
p.StartInfo.FileName = SvnDir + "//TortoiseProc.exe";
p.StartInfo.Arguments = " /command:commit /path:" + AssetsPath;
p.Start();
}
[MenuItem("<22><>Ŀ<EFBFBD><C4BF><EFBFBD><EFBFBD>/SVN<56>ύ/LubanĿ¼")]
static void SVNCommitLuban()
{
string exepath = LubanToolsPath;
if (!File.Exists(exepath + "/copy_Path.txt"))
{
Console.WriteLine("copy_Path <20><><EFBFBD>ò<EFBFBD><C3B2><EFBFBD><EFBFBD><EFBFBD>");
return;
}
string SrcDir = "";
string SvnDir = "";
string LubanDir = "";
string[] pathcfg = File.ReadAllText(exepath + "/copy_Path.txt").Split('\n'); ;
foreach (var pc in pathcfg)
{
var parr = pc.Split('=');
if (parr[0].Trim() == "SrcDir") SrcDir = parr[1].Trim();
if (parr[0].Trim() == "LubanDir") LubanDir = parr[1].Trim();
if (parr[0].Trim() == "SvnDir") SvnDir = parr[1].Trim();
}
if (string.IsNullOrEmpty(SvnDir))
{
Debug.LogError("<22><><EFBFBD><EFBFBD>lubanĿ¼copy_Path.txt<78><74><EFBFBD><EFBFBD><EFBFBD><EFBFBD>SVN<56><4E>װĿ¼bin<69>ļ<EFBFBD><C4BC><EFBFBD>,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD>SvnDir=C:\\Program Files\\TortoiseSVN\\bin");
return;
}
System.Diagnostics.Process p = new System.Diagnostics.Process();
p.StartInfo.FileName = SvnDir + "//TortoiseProc.exe";
p.StartInfo.Arguments = " /command:commit /path:" + LubanToolsPath;
p.Start();
}
[MenuItem("<22><>Ŀ<EFBFBD><C4BF><EFBFBD><EFBFBD>/SVN<56>ύ/<2F>߻<EFBFBD>Ŀ¼")]
static void SVNCommitPlanning()
{
string exepath = LubanToolsPath;
if (!File.Exists(exepath + "/copy_Path.txt"))
{
Console.WriteLine("copy_Path <20><><EFBFBD>ò<EFBFBD><C3B2><EFBFBD><EFBFBD><EFBFBD>");
return;
}
string SrcDir = "";
string SvnDir = "";
string LubanDir = "";
string[] pathcfg = File.ReadAllText(exepath + "/copy_Path.txt").Split('\n'); ;
foreach (var pc in pathcfg)
{
var parr = pc.Split('=');
if (parr[0].Trim() == "SrcDir") SrcDir = parr[1].Trim();
if (parr[0].Trim() == "LubanDir") LubanDir = parr[1].Trim();
if (parr[0].Trim() == "SvnDir") SvnDir = parr[1].Trim();
}
if (string.IsNullOrEmpty(SvnDir))
{
Debug.LogError("<22><><EFBFBD><EFBFBD>lubanĿ¼copy_Path.txt<78><74><EFBFBD><EFBFBD><EFBFBD><EFBFBD>SVN<56><4E>װĿ¼bin<69>ļ<EFBFBD><C4BC><EFBFBD>,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD>SvnDir=C:\\Program Files\\TortoiseSVN\\bin");
return;
}
System.Diagnostics.Process p = new System.Diagnostics.Process();
p.StartInfo.FileName = SvnDir + "//TortoiseProc.exe";
p.StartInfo.Arguments = " /command:commit /path:" + SrcDir;
p.Start();
}
[MenuItem("<22><>Ŀ<EFBFBD><C4BF><EFBFBD><EFBFBD>/<2F><><EFBFBD><EFBFBD>Ŀ¼/Assets")]
static void OpenAssetsDir()
{
System.Diagnostics.Process p = new System.Diagnostics.Process();
p.StartInfo.FileName = "explorer.exe";
p.StartInfo.Arguments = @" /select, "+ GameAssetsPath;
p.Start();
}
[MenuItem("<22><>Ŀ<EFBFBD><C4BF><EFBFBD><EFBFBD>/<2F><><EFBFBD><EFBFBD>Ŀ¼/Luban")]
static void OpenLubanDir()
{
System.Diagnostics.Process p = new System.Diagnostics.Process();
p.StartInfo.FileName = "explorer.exe";
p.StartInfo.Arguments = @" /select, " + LubanToolsDesignerConfigsPath;
p.Start();
}
[MenuItem("<22><>Ŀ<EFBFBD><C4BF><EFBFBD><EFBFBD>/<2F><><EFBFBD><EFBFBD>Ŀ¼/<2F>߻<EFBFBD>")]
static void OpenPlanningDir()
{
string exepath = LubanToolsPath;
if (!File.Exists(exepath + "/copy_Path.txt"))
{
Console.WriteLine("copy_Path <20><><EFBFBD>ò<EFBFBD><C3B2><EFBFBD><EFBFBD><EFBFBD>");
return;
}
string LubanDir;
string SrcDir = "";
string[] pathcfg = File.ReadAllText(exepath + "/copy_Path.txt").Split('\n'); ;
foreach (var pc in pathcfg)
{
var parr = pc.Split('=');
if (parr[0].Trim() == "SrcDir") SrcDir = parr[1].Trim();
if (parr[0].Trim() == "LubanDir") LubanDir = parr[1].Trim();
}
System.Diagnostics.Process p = new System.Diagnostics.Process();
p.StartInfo.FileName = "explorer.exe";
p.StartInfo.Arguments = @" /select, " + SrcDir;
p.Start();
}
[MenuItem("<22><>Ŀ<EFBFBD><C4BF><EFBFBD><EFBFBD>/<2F><><EFBFBD><EFBFBD>Ŀ¼/ProtoBuff")]
static void OpenProtoBuffDir()
{
string exepath = LubanToolsPath;
if (!File.Exists(exepath + "/copy_Path.txt"))
{
Console.WriteLine("copy_Path <20><><EFBFBD>ò<EFBFBD><C3B2><EFBFBD><EFBFBD><EFBFBD>");
return;
}
string ProtoBuffDir = "";
string[] pathcfg = File.ReadAllText(exepath + "/copy_Path.txt").Split('\n'); ;
foreach (var pc in pathcfg)
{
var parr = pc.Split('=');
if (parr[0].Trim() == "ProtoBuffDir") ProtoBuffDir = parr[1].Trim();
}
if (string.IsNullOrEmpty(ProtoBuffDir))
{
Debug.LogError("<22><><EFBFBD><EFBFBD>lubanĿ¼copy_Path.txt<78><74><EFBFBD><EFBFBD><EFBFBD><EFBFBD>SVN<56><4E>װĿ¼bin<69>ļ<EFBFBD><C4BC><EFBFBD>,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,ProtoBuffDir=D:\\Project\\proto");
return;
}
System.Diagnostics.Process p = new System.Diagnostics.Process();
p.StartInfo.FileName = "explorer.exe";
p.StartInfo.Arguments = @" /select, " + ProtoBuffDir;
p.Start();
}
private const int SW_SHOWNOMAL = 1;
private static void HandleRunningInstance(System.Diagnostics.Process instance)
{
ShowWindowAsync(instance.MainWindowHandle, SW_SHOWNOMAL);//<2F><>ʾ
SetForegroundWindow(instance.MainWindowHandle);//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ǰ<EFBFBD><C7B0>
}
#endif
}