91av视频/亚洲h视频/操亚洲美女/外国一级黄色毛片 - 国产三级三级三级三级

  • 大小: 2KB
    文件類型: .zip
    金幣: 2
    下載: 0 次
    發布日期: 2021-06-05
  • 語言: 其他
  • 標簽: Unity??Svn??工具??源碼??

資源簡介

在Unity中快速使用svn的小工具。 從此不用只是在打開文件夾后去做svn操作,而可以在unity環境下點擊文件右鍵直接操作svn。

資源截圖

代碼片段和文件信息

using?UnityEngine;
using?UnityEditor;
using?System.Collections;

///?
///?Unity?Svn?工具
///?參考:?http://www.cnblogs.com/me115/archive/2011/05/31/2064047.html?
///?官網:http://tortoisesvn.net/docs/release/TortoiseSVN_zh_CN/tsvn-automation.html?
///?

public?class?MiniSvn
{
????#region?-?SVN?-

????[MenuItem(“Assets/SVN/showlog“)]
????static?void?ExternalSvnShowLog()
????{
????????SvnShowLog(GetCurProjectObjPath());
????}
????[MenuItem(“Assets/SVN/add“)]
????static?void?ExternalSvnAdd()
????{
????????SvnAdd(GetCurProjectObjPath());
????}
????[MenuItem(“Assets/SVN/commit“)]
????static?void?ExternalSvnCommit()
????{
????????SvnCommit(GetCurProjectObjPath());
????}
????[MenuItem(“Assets/SVN/update“)]
????static?void?ExternalSvnUpdate()
????{
????????SvnUpdate(GetCurProjectObjPath());
????}

????static?string?GetCurProjectObjPath()
????{
????????if?(null?==?Selection.objects?||?Selection.objects.Length?!=?1)?return?string.Empty;

????????string?path?=?AssetDatabase.GetAssetPath(Selection.objects[0].GetInstanceID());
????????if?(!string.IsNullOrEmpty(path))
????????{
????????????path?=?System.IO.Path.GetFullPath(path);
????????}
????????return?path;
????}

????#endregion

????private?const?string?SVN_EXE_PATH?=?“C:\\Program?Files\\TortoiseSVN\\bin\\TortoiseProc.exe“;

????public?static?void?SvnShowLog(string?filePath)
????{
????????string?args?=?“/command:log?/path:“?+?filePath?+?“?/closeonend:0“;
????????//?快捷方式
????????System.Diagnostics.Process.Start(SVN_EXE_PATH?args);
????????//?cmd方式
????????//string[]?cmdArray?=?new?string[]
????????//{
????????//????“cd?C:\\Program?Files\\TortoiseSVN\\bin\\“
????????//????“TortoiseProc.exe“?+?“?“?+?args
????????//};
????????//RunCmd(cmdArray);
????}

????public?static?void?SvnAdd(string?filePath)
????{
????????string?addRes?=?filePath;
????????if?(System.IO.File.Exists(filePath))
????????{
????????????addRes?=?System.IO.Path.GetDirectoryName(filePath);
????????}
????????string?args?=?“/command:add?/path:“?+?addRes?+?“?/closeonend:0“;
????????System.Diagnostics.Process.Start(SVN_EXE_PATH?args);
????}

????public?static?void?SvnCommit(string?filePath)
????{
????????string?args?=?“/command:commit?/path:“?+?filePath?+?“?/logmsg:res:?ui“?+?“?/closeonend:0“;
????????System.Diagnostics.Process.Start(SVN_EXE_PATH?args);
????}

????public?static?void?SvnUpdate(string?filePath)
????{
????????string?args?=?“/command:update?/path:“?+?filePath?+?“?/closeonend:0“;
????????System.Diagnostics.Process.Start(SVN_EXE_PATH?args);
????}

????private?static?void?RunCmd(string[]?cmds)
????{
????????System.Diagnostics.Process?proc?=?new?System.Diagnostics.Process();
????????proc.StartInfo.CreateNoWindow?=?true;
????????proc.StartInfo.FileName?=?“cmd.exe“;
????????proc.StartInfo.UseShellExecute?=?false;
????????proc.StartInfo.RedirectStandardError?=?true;
????????proc.StartInfo.RedirectStandardInput

?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????目錄???????????0??2015-07-07?10:39??Unity?Svn?工具\
?????文件????????3287??2015-07-07?10:37??Unity?Svn?工具\MiniSvn.cs
?????文件?????????178??2015-07-07?10:07??Unity?Svn?工具\MiniSvn.cs.meta

評論

共有 條評論