From 4d5fcaf7d1c87dced6f9966d1963048136df1ab2 Mon Sep 17 00:00:00 2001
From: client_Wu Xijin <364452445@qq.com>
Date: 星期四, 25 十月 2018 15:04:04 +0800
Subject: [PATCH] 4334 【前端】随包资源支持热更

---
 Core/GameEngine/Model/TelPartialConfig/PartialContactConfig.cs      |   37 ++++++++++++++++++
 Core/GameEngine/Model/TelPartialConfig/PartialContactConfig.cs.meta |   12 ++++++
 Core/GameEngine/Model/Config/ContactConfig.cs.meta                  |    2 
 System/Launch/LaunchWin.cs                                          |   10 ++++-
 Core/GameEngine/Model/Config/ContactConfig.cs                       |   16 +++++--
 System/UserHelp/UserHelpWin.cs                                      |   41 ++++++++++++++++++--
 6 files changed, 105 insertions(+), 13 deletions(-)

diff --git a/Core/GameEngine/Model/Config/ContactConfig.cs b/Core/GameEngine/Model/Config/ContactConfig.cs
index cb4e900..57e927a 100644
--- a/Core/GameEngine/Model/Config/ContactConfig.cs
+++ b/Core/GameEngine/Model/Config/ContactConfig.cs
@@ -1,6 +1,6 @@
 锘�//--------------------------------------------------------
 //    [Author]:			绗簩涓栫晫
-//    [  Date ]:		   Monday, October 15, 2018
+//    [  Date ]:		   Thursday, October 25, 2018
 //--------------------------------------------------------
 
 using UnityEngine;
@@ -11,23 +11,29 @@
     
 	public partial class ContactConfig : ConfigBase {
 
+		public int id { get ; private set ; }
 		public string appid { get ; private set; } 
+		public int branch { get ; private set ; }
 		public string qq { get ; private set; } 
 		public string phone { get ; private set; } 
 
 		public override string getKey()
         {
-            return appid.ToString();
+            return id.ToString();
         }
 
 		public override void Parse() {
 			try
             {
-                appid = rawContents[0].Trim();
+                id=IsNumeric(rawContents[0]) ? int.Parse(rawContents[0]):0; 
 			
-				qq = rawContents[1].Trim();
+				appid = rawContents[1].Trim();
 			
-				phone = rawContents[2].Trim();
+				branch=IsNumeric(rawContents[2]) ? int.Parse(rawContents[2]):0; 
+			
+				qq = rawContents[3].Trim();
+			
+				phone = rawContents[4].Trim();
             }
             catch (Exception ex)
             {
diff --git a/Core/GameEngine/Model/Config/ContactConfig.cs.meta b/Core/GameEngine/Model/Config/ContactConfig.cs.meta
index f33beaa..f66daa5 100644
--- a/Core/GameEngine/Model/Config/ContactConfig.cs.meta
+++ b/Core/GameEngine/Model/Config/ContactConfig.cs.meta
@@ -1,6 +1,6 @@
 fileFormatVersion: 2
 guid: 8ecbb84f62ba262448b74256777f91ec
-timeCreated: 1539586414
+timeCreated: 1540450970
 licenseType: Pro
 MonoImporter:
   serializedVersion: 2
diff --git a/Core/GameEngine/Model/TelPartialConfig/PartialContactConfig.cs b/Core/GameEngine/Model/TelPartialConfig/PartialContactConfig.cs
new file mode 100644
index 0000000..9dbd498
--- /dev/null
+++ b/Core/GameEngine/Model/TelPartialConfig/PartialContactConfig.cs
@@ -0,0 +1,37 @@
+锘縰sing System.Collections;
+using System.Collections.Generic;
+using UnityEngine;
+
+namespace TableConfig
+{
+
+    public partial class ContactConfig : ConfigBase
+    {
+
+        public static ContactConfig GetConfig(string appid, int branch)
+        {
+            ContactConfig config = null;
+            foreach (var item in Config.Instance.GetAllValues<ContactConfig>())
+            {
+                if (item.appid == appid)
+                {
+                    if (config == null)
+                    {
+                        config = item;
+                    }
+                    else
+                    {
+                        if (item.branch == branch)
+                        {
+                            config = item;
+                        }
+                    }
+                }
+            }
+
+            return config;
+        }
+
+    }
+
+}
diff --git a/Core/GameEngine/Model/TelPartialConfig/PartialContactConfig.cs.meta b/Core/GameEngine/Model/TelPartialConfig/PartialContactConfig.cs.meta
new file mode 100644
index 0000000..cb1abeb
--- /dev/null
+++ b/Core/GameEngine/Model/TelPartialConfig/PartialContactConfig.cs.meta
@@ -0,0 +1,12 @@
+fileFormatVersion: 2
+guid: 015500ded68878241bee5ee8d4d1d459
+timeCreated: 1540448380
+licenseType: Pro
+MonoImporter:
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 
diff --git a/System/Launch/LaunchWin.cs b/System/Launch/LaunchWin.cs
index 3f6e102..c58fe03 100644
--- a/System/Launch/LaunchWin.cs
+++ b/System/Launch/LaunchWin.cs
@@ -46,7 +46,10 @@
 
         protected override void AddListeners()
         {
-            m_UserHelp.SetListener(OpenUserHelp);
+            if (m_UserHelp)
+            {
+                m_UserHelp.SetListener(OpenUserHelp);
+            }
         }
 
         protected override void OnPreOpen()
@@ -60,7 +63,10 @@
             m_Version.text = StringUtility.Contact(VersionConfig.Get().version, "_", VersionConfig.Get().buildIndex);
             m_BuildTime.text = VersionConfig.Get().debugVersion ? VersionConfig.Get().buildTime : "";
 
-            m_UserHelp.gameObject.SetActive(Config.Instance.ContainKey<ContactConfig>(VersionConfig.Get().appId));
+            if (m_UserHelp)
+            {
+                m_UserHelp.gameObject.SetActive(Config.Instance.ContainKey<ContactConfig>(VersionConfig.Get().appId));
+            }
 
             if (Application.platform == RuntimePlatform.IPhonePlayer)
             {
diff --git a/System/UserHelp/UserHelpWin.cs b/System/UserHelp/UserHelpWin.cs
index 25410c7..051b537 100644
--- a/System/UserHelp/UserHelpWin.cs
+++ b/System/UserHelp/UserHelpWin.cs
@@ -25,6 +25,7 @@
         [SerializeField] ScrollRect m_IssueScrollRect;
         [SerializeField] UserIssueBehaviour m_IssueBehaviourPattern;
         [SerializeField] RectTransform m_ContactContainer;
+        [SerializeField] Text m_QQTitle;
         [SerializeField] Text m_QQ;
         [SerializeField] Text m_Phone;
         [SerializeField] Button m_CopyQQ;
@@ -106,8 +107,13 @@
 
         private void InitContact()
         {
-            var config = Config.Instance.Get<ContactConfig>(VersionConfig.Get().appId);
-            m_QQ.text = Language.GetFromLocal(31, config.qq);
+            var config = GetConfig(VersionConfig.Get().appId, VersionConfig.Get().branch);
+
+            m_QQTitle.text = Language.GetFromLocal(31);
+            var qqContent = config.qq.Split('|');
+            m_QQ.text = string.Join("\r\n", qqContent);
+            m_CopyQQ.gameObject.SetActive(qqContent.Length == 1);
+
             m_Phone.text = Language.GetFromLocal(32, config.phone);
         }
 
@@ -127,8 +133,8 @@
         {
             if (Application.isMobilePlatform)
             {
-                var config = Config.Instance.Get<ContactConfig>(VersionConfig.Get().appId);
-                SDKUtility.Instance.CopyContent(config.qq);
+                var config = GetConfig(VersionConfig.Get().appId, VersionConfig.Get().branch);
+                SDKUtility.Instance.CopyContent(m_QQ.text);
                 m_CopySucceedTip.Display(Language.GetFromLocal(33));
             }
         }
@@ -137,12 +143,37 @@
         {
             if (Application.isMobilePlatform)
             {
-                var config = Config.Instance.Get<ContactConfig>(VersionConfig.Get().appId);
+                var config = GetConfig(VersionConfig.Get().appId, VersionConfig.Get().branch);
                 SDKUtility.Instance.CopyContent(config.phone);
                 m_CopySucceedTip.Display(Language.GetFromLocal(33));
             }
         }
 
+
+        private ContactConfig GetConfig(string appid, int branch)
+        {
+            ContactConfig config = null;
+            foreach (var item in Config.Instance.GetAllValues<ContactConfig>())
+            {
+                if (item.appid == appid)
+                {
+                    if (config == null)
+                    {
+                        config = item;
+                    }
+                    else
+                    {
+                        if (item.branch == branch)
+                        {
+                            config = item;
+                        }
+                    }
+                }
+            }
+
+            return config;
+        }
+
     }
 
 }

--
Gitblit v1.8.0