From f2cd8cf71a54e251e5f507c7d69c6f91f90e5074 Mon Sep 17 00:00:00 2001
From: client_Hale <339726288@qq.com>
Date: 星期二, 25 九月 2018 20:23:14 +0800
Subject: [PATCH] Merge branch 'master' of http://192.168.0.87:10010/r/snxxz_scripts

---
 System/ClientVersion/VersionUpdateWin.cs |   50 ++++++++++++++++++++++++++++++++++----------------
 1 files changed, 34 insertions(+), 16 deletions(-)

diff --git a/System/ClientVersion/VersionUpdateWin.cs b/System/ClientVersion/VersionUpdateWin.cs
index 1bd9bee..f73a3f0 100644
--- a/System/ClientVersion/VersionUpdateWin.cs
+++ b/System/ClientVersion/VersionUpdateWin.cs
@@ -16,7 +16,9 @@
     public class VersionUpdateWin : Window
     {
         [SerializeField] RectTransform m_ContainerHint;
-        [SerializeField] RichText m_Content;
+        [SerializeField] RichText m_HintDescription;
+        [SerializeField] RectTransform m_UpdateContentContainer;
+        [SerializeField] RichText m_UpdateCotent;
         [SerializeField] Button m_Confirm;
 
         [SerializeField] Transform m_ContainerProgress;
@@ -108,14 +110,13 @@
         private void DisplayHintContent()
         {
             var step = VersionUtility.Instance.step;
-
             switch (step)
             {
                 case VersionUtility.Step.None:
-                    m_Content.text = Language.GetFromLocal(4);
+                    m_HintDescription.text = Language.GetFromLocal(4);
                     break;
                 case VersionUtility.Step.ApkExist:
-                    m_Content.text = Language.GetFromLocal(5);
+                    m_HintDescription.text = Language.GetFromLocal(5);
                     break;
                 case VersionUtility.Step.DownLoadPrepared:
                     if (Application.platform == RuntimePlatform.Android)
@@ -125,28 +126,49 @@
                         switch (Application.internetReachability)
                         {
                             case NetworkReachability.NotReachable:
-                                m_Content.text = Language.GetFromLocal(6, sizeDescription);
+                                m_HintDescription.text = Language.GetFromLocal(6, sizeDescription);
                                 break;
                             case NetworkReachability.ReachableViaCarrierDataNetwork:
-                                m_Content.text = Language.GetFromLocal(7, sizeDescription);
+                                m_HintDescription.text = Language.GetFromLocal(7, sizeDescription);
                                 break;
                             case NetworkReachability.ReachableViaLocalAreaNetwork:
-                                m_Content.text = Language.GetFromLocal(8, sizeDescription);
+                                m_HintDescription.text = Language.GetFromLocal(8, sizeDescription);
                                 break;
                         }
                     }
                     else if (Application.platform == RuntimePlatform.IPhonePlayer)
                     {
-                        m_Content.text = Language.GetFromLocal(9);
+                        m_HintDescription.text = Language.GetFromLocal(9);
                     }
                     break;
                 case VersionUtility.Step.DownLoad:
-                    m_Content.text = Language.GetFromLocal(3);
+                    m_HintDescription.text = Language.GetFromLocal(3);
                     break;
                 case VersionUtility.Step.DownLoadFailed:
-                    m_Content.text = Language.GetFromLocal(10);
+                    m_HintDescription.text = Language.GetFromLocal(10);
                     break;
             }
+
+            switch (step)
+            {
+                case VersionUtility.Step.ApkExist:
+                case VersionUtility.Step.DownLoadPrepared:
+                    var updateContent = VersionUtility.Instance.GetUpdateContent();
+                    if (string.IsNullOrEmpty(updateContent))
+                    {
+                        m_UpdateContentContainer.gameObject.SetActive(false);
+                    }
+                    else
+                    {
+                        m_UpdateContentContainer.gameObject.SetActive(true);
+                        m_UpdateCotent.text = updateContent;
+                    }
+                    break;
+                default:
+                    m_UpdateContentContainer.gameObject.SetActive(false);
+                    break;
+            }
+
         }
 
         private void Confirm()
@@ -160,11 +182,7 @@
                     VersionUtility.Instance.RequestVersionCheck();
                     break;
                 case VersionUtility.Step.ApkExist:
-                    var version = VersionUtility.Instance.versionInfo.GetLatestVersion();
-                    var remoteURL = version.download_url;
-                    var fileName = Path.GetFileName(remoteURL);
-                    var apkLocalURL = StringUtility.Contact(VersionUtility.Instance.androidRoot, "/", fileName);
-                    SDKUtility.Instance.InstallAPK(apkLocalURL);
+                    SDKUtility.Instance.InstallAPK(VersionUtility.Instance.GetApkLocalUrl());
                     break;
                 case VersionUtility.Step.DownLoadPrepared:
                     if (Application.platform == RuntimePlatform.Android)
@@ -173,7 +191,7 @@
                     }
                     else if (Application.platform == RuntimePlatform.IPhonePlayer)
                     {
-                        Application.OpenURL(VersionUtility.Instance.versionInfo.GetLatestVersion().download_url);
+                        Application.OpenURL(VersionUtility.Instance.GetApkRemoteUrl());
                         //鎵撳紑搴旂敤鍟嗗簵閾炬帴
                     }
                     break;

--
Gitblit v1.8.0