首先我们的工程跟SVN绑定后
Editor文件夹下创建一个C#脚本命名随便,案例命名为:SvnOperater
粘贴下面的代码就可以了
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using UnityEditor;
using UnityEngine;
public class SvnOperater : MonoBehaviour
{
[MenuItem("SVN/Update")]
public static void Update()
{
#if UNITY_STANDALONE_WIN || UNITY_EDITOR
Process.Start("TortoiseProc.exe", "/command:update /path:" + Application.dataPath + " /closeonend:0");
#endif
}
[MenuItem("SVN/Commit")]
public static void Commit()
{
#if UNITY_STANDALONE_WIN || UNITY_EDITOR
Process.Start("TortoiseProc.exe", "/command:commit /path:" + Application.dataPath + " /closeonend:0");
#endif
}
}
左上方就会多一个SVN的选项点击后会有一个更新一个提交这样就不用了每次都打开文件夹了