资源导入自动上传提交
parent
2490fbb496
commit
06cf7f6cdd
|
|
@ -21,6 +21,7 @@ namespace GameEditor.Util
|
|||
string[] usedPath;
|
||||
bool[] usedPathSelect;
|
||||
string[] filePath;
|
||||
List<string> upLoadPathList;
|
||||
[MenuItem("资源导入/资源导入")]
|
||||
static void InitWindow()
|
||||
{
|
||||
|
|
@ -80,9 +81,6 @@ namespace GameEditor.Util
|
|||
}
|
||||
EditorGUILayout.EndHorizontal();
|
||||
|
||||
|
||||
|
||||
|
||||
EditorGUILayout.BeginHorizontal();
|
||||
GUILayout.Label("导入路径");
|
||||
GUILayout.Label(tag1);
|
||||
|
|
@ -96,6 +94,7 @@ namespace GameEditor.Util
|
|||
}
|
||||
if (GUILayout.Button("导入", GUILayout.ExpandWidth(false)))
|
||||
{
|
||||
upLoadPathList = new List<string>();
|
||||
string path = "";
|
||||
for (int i = 0; i < usedPathSelect.Length; i++)
|
||||
{
|
||||
|
|
@ -112,8 +111,37 @@ namespace GameEditor.Util
|
|||
}
|
||||
EditorGUILayout.EndHorizontal();
|
||||
|
||||
|
||||
if (GUILayout.Button("上传", GUILayout.ExpandWidth(false)))
|
||||
{
|
||||
string v = "";
|
||||
for (int i = 0; i < upLoadPathList.Count(); i++)
|
||||
{
|
||||
if (string.IsNullOrEmpty(v))
|
||||
{
|
||||
v = upLoadPathList[i];
|
||||
}
|
||||
else
|
||||
{
|
||||
v = v + "," + upLoadPathList[i];
|
||||
}
|
||||
}
|
||||
string s = string.Format("/K 一键提交到git.bat {0}", v);
|
||||
System.Diagnostics.Process.Start("cmd.exe", s);
|
||||
}
|
||||
|
||||
EditorGUILayout.EndVertical();
|
||||
}
|
||||
|
||||
void SetUpLoadPathList(string subPath)
|
||||
{
|
||||
if (upLoadPathList.Contains(subPath))
|
||||
{
|
||||
return;
|
||||
}
|
||||
upLoadPathList.Add(subPath);
|
||||
}
|
||||
|
||||
void ImportTexture(string path)
|
||||
{
|
||||
if (filePath == null || filePath.Length < 2)
|
||||
|
|
@ -125,6 +153,7 @@ namespace GameEditor.Util
|
|||
if (!Directory.Exists(fullPath))
|
||||
{
|
||||
Directory.CreateDirectory(fullPath);
|
||||
SetUpLoadPathList(tag1 + "/" + path);
|
||||
AssetDatabase.Refresh();
|
||||
}
|
||||
string desPath = Environment.CurrentDirectory + "/Assets/ImportFloder";
|
||||
|
|
@ -176,11 +205,14 @@ namespace GameEditor.Util
|
|||
if (sourceExt == desExt)
|
||||
{
|
||||
AssetDatabase.CopyAsset("Assets/ImportFloder/" + fileName, desFilePath);
|
||||
SetUpLoadPathList(desFilePath);
|
||||
}
|
||||
else
|
||||
{
|
||||
AssetDatabase.MoveAssetToTrash(desFilePath);
|
||||
SetUpLoadPathList(desFilePath);
|
||||
AssetDatabase.MoveAsset("Assets/ImportFloder/" + fileName, rootPath + "/" + fileName);
|
||||
SetUpLoadPathList(rootPath + "/" + sourceFileName);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -189,6 +221,7 @@ namespace GameEditor.Util
|
|||
if (!isReplace)
|
||||
{
|
||||
AssetDatabase.MoveAsset("Assets/ImportFloder/" + fileName, Path.Combine(tag1, path) + "/" + fileName);
|
||||
SetUpLoadPathList(Path.Combine(tag1, path) + "/" + sourceFileName);
|
||||
}
|
||||
}
|
||||
AssetDatabase.StopAssetEditing();
|
||||
|
|
|
|||
|
|
@ -0,0 +1,22 @@
|
|||
@echo off
|
||||
set words=%*
|
||||
:: 获取当前脚本的路径
|
||||
cd /d %~dp0
|
||||
:: 自动提交
|
||||
git init
|
||||
for %%i in (%words%) do (
|
||||
git add %%i*
|
||||
)
|
||||
|
||||
git commit -m "bat批处理自动推送:%date:~0,10%,%time:~0,8%"
|
||||
:: git commit -m "%commitMessage%"
|
||||
git push origin master
|
||||
@echo 已经完成,
|
||||
|
||||
SET daoTime=60
|
||||
:dao
|
||||
set /a daoTime=daoTime-1
|
||||
ping -n 2 -w 500 127.1>nul
|
||||
cls
|
||||
echo 上传Git完成 ,倒计时退出: %daoTime%秒
|
||||
if %daoTime%==0 (exit) else (goto dao)
|
||||
Loading…
Reference in New Issue