guodong 1 год назад
Родитель
Сommit
8f9b884375

+ 11 - 2
GameClient/Assets/Game/HotUpdate/HotUpdateDriver.cs

@@ -45,11 +45,20 @@ namespace GFGGame
             }
         }
 
+        private float pauseTime;
+
         private void OnApplicationPause(bool pause)
         {
-            if(!pause)
+            if(pause)
+            {
+                pauseTime = Time.realtimeSinceStartup;
+            }
+            else
             {
-                StartCoroutine(CheckVersion(VersionController.DefaultPackage));
+                if(Time.realtimeSinceStartup - pauseTime > 300 || LauncherConfig.netType == LauncherConfig.EnumNetType.LOCAL)
+                {
+                    StartCoroutine(CheckVersion(VersionController.DefaultPackage));
+                }
             }
         }
 

+ 7 - 7
GameClient/Assets/Game/HotUpdate/UGUI/UICGView.cs

@@ -4,7 +4,6 @@ using UnityEngine.Video;
 using YooAsset;
 using GFGGame.Launcher;
 using System.Collections;
-using System;
 
 namespace GFGGame
 {
@@ -20,7 +19,6 @@ namespace GFGGame
         private Button BtnSkipVertical;
         private Button BtnSkipHorizontal;
         private VideoPlayer videoPlayer;
-        private Coroutine fadeCoroutine;
 
         public void Show()
         {
@@ -71,13 +69,15 @@ namespace GFGGame
         private void OnVideoPrepared(VideoPlayer source)
         {
             videoPlayer.prepareCompleted -= OnVideoPrepared;
-            fadeCoroutine = StartCoroutine(FadeButtonOverTime());
+            StartCoroutine(FadeButtonOverTime(BtnFullScreen));
+            StartCoroutine(FadeButtonOverTime(BtnSkipVertical));
+            StartCoroutine(FadeButtonOverTime(BtnSkipHorizontal));
         }
 
-        IEnumerator FadeButtonOverTime()
+        IEnumerator FadeButtonOverTime(Button btn)
         {
-            Image buttonImage = BtnFullScreen.GetComponent<Image>();
-            Text buttonText = BtnFullScreen.GetComponentInChildren<Text>();
+            Image buttonImage = btn.GetComponent<Image>();
+            Text buttonText = btn.GetComponentInChildren<Text>();
             yield return new WaitForSeconds((float)videoPlayer.length - 3f);
             if (buttonImage != null)
             {
@@ -106,7 +106,6 @@ namespace GFGGame
                 buttonImage.color = targetColor;
                 buttonText.color = targetColorText;
             }
-            fadeCoroutine = null;
         }
 
         private void OnVideoEnded(VideoPlayer source)
@@ -138,6 +137,7 @@ namespace GFGGame
 
         public void Hide()
         {
+            StopAllCoroutines();
             videoPlayer.Stop();
             videoPlayer.loopPointReached -= OnVideoEnded;
             handle.Release();

+ 8 - 2
GameClient/Assets/Game/HotUpdate/Views/Login/LoginView.cs

@@ -82,8 +82,14 @@ namespace GFGGame
 
             if(GameConfig.openTime > TimeHelper.ClientNow())
             {
-                AlertUI.Show("未到开放时间!")
-                        .SetLeftButton(true, "稍后再试", (obj) =>
+                var date = DateTimeUtil.LongTimeStampToDateTime(GameConfig.openTime);
+                string minuteText = "";
+                if(date.Minute > 0)
+                {
+                    minuteText = date.Minute + "分";
+                }
+                AlertUI.Show($"    亲爱的研究员,万世镜将于{date.Year}年{date.Month}月{date.Day}日{date.Hour}点{minuteText}开放,敬请期待!")
+                        .SetLeftButton(true, "好的", (obj) =>
                         {
                             Application.Quit();
                         });