【Version工具】修改配置文件走svn
parent
1fbfcb13ce
commit
7d8bb2bc36
|
@ -32,3 +32,4 @@ BuildABs/Android/
|
|||
ExportProject/
|
||||
BattleRecord/
|
||||
*.csproj
|
||||
ClientConfig/
|
||||
|
|
|
@ -0,0 +1,8 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 6f85285cf16cbc44f96244eb7c68f8f6
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -0,0 +1,45 @@
|
|||
using System;
|
||||
using System.IO;
|
||||
using UnityEngine;
|
||||
using UnityEditor;
|
||||
using GameEditor.Util;
|
||||
public class ClientConfigManager
|
||||
{
|
||||
|
||||
private static ClientConfigManager _instance;
|
||||
public static ClientConfigManager Instance
|
||||
{
|
||||
get
|
||||
{
|
||||
if (_instance == null)
|
||||
{
|
||||
if (_instance == null)
|
||||
{
|
||||
_instance = new ClientConfigManager();
|
||||
}
|
||||
}
|
||||
return _instance;
|
||||
}
|
||||
}
|
||||
|
||||
private string svnPath = "svn://60.1.1.230/jieling/ClientConfig";
|
||||
private string localPath = Application.dataPath + "/../ClientConfig";
|
||||
|
||||
public void SVN_Update()
|
||||
{
|
||||
if (!Directory.Exists(localPath))
|
||||
{
|
||||
Directory.CreateDirectory(localPath);
|
||||
ProcessUtil.ProcessCommand(Application.dataPath, "svn checkout " + svnPath + " "+ localPath);
|
||||
}
|
||||
ProcessUtil.ProcessCommand(localPath, "svn update");
|
||||
}
|
||||
|
||||
public string[] GetVersionList()
|
||||
{
|
||||
string versionPath = localPath + "/Version";
|
||||
string[] list = Directory.GetDirectories(versionPath);
|
||||
Debug.LogError(list.Length);
|
||||
return list;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 6c926022158ec844398d3823239f8559
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -255,7 +255,7 @@ namespace GameEditor.FrameTool {
|
|||
public class VersionWindow : EditorWindow
|
||||
{
|
||||
static string versionPath = Application.dataPath + "/../Version";
|
||||
static string editorVersion = Application.dataPath + "/../AssetBundles/" + AppConst.GameVersionFile;
|
||||
static string editorVersion = Application.dataPath + "/../AssetBundles";// + AppConst.GameVersionFile;
|
||||
//static string persistVersion = Application.dataPath + "/Resources/version.txt";
|
||||
static string streamVersion = AppConst.StreamPath + AppConst.GameVersionFile;
|
||||
|
||||
|
@ -283,9 +283,10 @@ namespace GameEditor.FrameTool {
|
|||
// 加载version文件
|
||||
private static void LoadVersion(string path)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(path) && File.Exists(path))
|
||||
versionPath = path + "/" + AppConst.GameVersionFile;
|
||||
if (!string.IsNullOrEmpty(versionPath) && File.Exists(versionPath))
|
||||
{
|
||||
string json = File.ReadAllText(path);
|
||||
string json = File.ReadAllText(versionPath);
|
||||
m_VersionTxt = JsonUtility.FromJson<VersionTxt>(json);
|
||||
}
|
||||
if (!path.Equals(editorVersion))
|
||||
|
@ -322,11 +323,12 @@ namespace GameEditor.FrameTool {
|
|||
// 加载version目录
|
||||
private static void LoadDic()
|
||||
{
|
||||
if (!string.IsNullOrEmpty(versionPath) && Directory.Exists(versionPath))
|
||||
{
|
||||
m_Files = Directory.GetFiles(versionPath, "*.txt", SearchOption.AllDirectories);
|
||||
m_Choose = new bool[m_Files.Length];
|
||||
}
|
||||
//if (!string.IsNullOrEmpty(versionPath) && Directory.Exists(versionPath))
|
||||
//{
|
||||
ClientConfigManager.Instance.SVN_Update();
|
||||
m_Files = ClientConfigManager.Instance.GetVersionList();//Directory.GetFiles(versionPath, "*.txt", SearchOption.AllDirectories);
|
||||
m_Choose = new bool[m_Files.Length];
|
||||
//}
|
||||
}
|
||||
void OnGUI()
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue