From 7d8bb2bc36ef350bd2cac8eedd0416721bd364dd Mon Sep 17 00:00:00 2001 From: gaoxin Date: Fri, 3 Sep 2021 15:54:33 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90Version=E5=B7=A5=E5=85=B7=E3=80=91?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=85=8D=E7=BD=AE=E6=96=87=E4=BB=B6=E8=B5=B0?= =?UTF-8?q?svn?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 1 + Assets/ClientConfig.meta | 8 ++++ Assets/Editor/ClientConfigManager.cs | 45 +++++++++++++++++++ Assets/Editor/ClientConfigManager.cs.meta | 11 +++++ .../GameEditor/FrameTool/BuildWindow.cs | 18 ++++---- 5 files changed, 75 insertions(+), 8 deletions(-) create mode 100644 Assets/ClientConfig.meta create mode 100644 Assets/Editor/ClientConfigManager.cs create mode 100644 Assets/Editor/ClientConfigManager.cs.meta diff --git a/.gitignore b/.gitignore index 8af7a4f0b3..0332f64060 100644 --- a/.gitignore +++ b/.gitignore @@ -32,3 +32,4 @@ BuildABs/Android/ ExportProject/ BattleRecord/ *.csproj +ClientConfig/ diff --git a/Assets/ClientConfig.meta b/Assets/ClientConfig.meta new file mode 100644 index 0000000000..41b38bf837 --- /dev/null +++ b/Assets/ClientConfig.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 6f85285cf16cbc44f96244eb7c68f8f6 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Editor/ClientConfigManager.cs b/Assets/Editor/ClientConfigManager.cs new file mode 100644 index 0000000000..3975615079 --- /dev/null +++ b/Assets/Editor/ClientConfigManager.cs @@ -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; + } +} \ No newline at end of file diff --git a/Assets/Editor/ClientConfigManager.cs.meta b/Assets/Editor/ClientConfigManager.cs.meta new file mode 100644 index 0000000000..50dccbc2ac --- /dev/null +++ b/Assets/Editor/ClientConfigManager.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 6c926022158ec844398d3823239f8559 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/Editor/GameEditor/FrameTool/BuildWindow.cs b/Assets/Scripts/Editor/GameEditor/FrameTool/BuildWindow.cs index fe26a53bb4..a547ab6f6c 100644 --- a/Assets/Scripts/Editor/GameEditor/FrameTool/BuildWindow.cs +++ b/Assets/Scripts/Editor/GameEditor/FrameTool/BuildWindow.cs @@ -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(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() {