From 5edd7840804c3ededfb75bd6998a4997171ae014 Mon Sep 17 00:00:00 2001 From: CaiYanPeng Date: Wed, 26 Jan 2022 10:32:21 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B6=88=E6=81=AF=E9=80=9A=E7=9F=A5=E9=80=BB?= =?UTF-8?q?=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Assets/Scripts/App.cs | 3 ++ Assets/Scripts/Scenes/LoginController.cs | 29 ++++++++++++++----- Assets/Scripts/UI/Prefab/NewsController.cs | 9 ++++++ .../UI/Prefab/Panel/MapListController.cs | 2 +- ProjectSettings/EditorBuildSettings.asset | 4 +-- 5 files changed, 37 insertions(+), 10 deletions(-) diff --git a/Assets/Scripts/App.cs b/Assets/Scripts/App.cs index b9aef786..50afeec2 100644 --- a/Assets/Scripts/App.cs +++ b/Assets/Scripts/App.cs @@ -63,6 +63,8 @@ public static class App //全局用 输入框或者下拉框修改标志位 public static bool isChanged { get; set; } public static string notifyContent { get; internal set; } + //全局用,如果弹多条消息用这个队列 + public static Queue multiNotifyContent; public static RideSetting RideSetting = new RideSetting(); public static string pageName { get; set; } @@ -229,6 +231,7 @@ public static class App } //App.ChangeLanguage("en"); globalMessageQueue = new Queue(); + multiNotifyContent = new Queue(); Screen.sleepTimeout = SleepTimeout.NeverSleep; } } diff --git a/Assets/Scripts/Scenes/LoginController.cs b/Assets/Scripts/Scenes/LoginController.cs index aa10c729..48b8dea4 100644 --- a/Assets/Scripts/Scenes/LoginController.cs +++ b/Assets/Scripts/Scenes/LoginController.cs @@ -622,12 +622,21 @@ public class LoginController : BaseScene //#endif App.notifyContent = r.data.Value("Content"); - if (r.data.Value("Id") != notifyId && r.data.Value("Id") != 0)//r.data.Value("Id") != notifyId + if (r.data.Value("Id") > 1)//r.data.Value("Id") != notifyId { UIManager.ShowNewsModal(); PlayerPrefs.SetInt("notifyId", r.data.Value("Id")); } #else + if (r.data.Value("Id") > 1) + { + App.notifyContent = r.data.Value("Content"); + UIManager.ShowNewsModal(); + } + else + { + App.notifyContent = null; + } var rr = await ConfigHelper.userApi.GetVersions(); if (rr.result) { @@ -643,18 +652,24 @@ public class LoginController : BaseScene if (ver.UpdateLog.Count + 1 != notifyId) //ver.UpdateLog.Count != notifyId { var log = ver.UpdateLog.FirstOrDefault(); - if (log != null) + if (App.notifyContent == null) { - App.notifyContent = log.Desc; + if (log != null) + { + App.notifyContent = log.Desc; + } + else + { + App.notifyContent = r.data.Value("Content"); + } + UIManager.ShowNewsModal(); } - else + else { - App.notifyContent = r.data.Value("Content"); + App.multiNotifyContent.Enqueue(log != null ? log.Desc : r.data.Value("Content")); } PlayerPrefs.SetInt("notifyId", ver.UpdateLog.Count + 1); - UIManager.ShowNewsModal(); } - #endif } GetRotateImage(); diff --git a/Assets/Scripts/UI/Prefab/NewsController.cs b/Assets/Scripts/UI/Prefab/NewsController.cs index a9467c3c..f5951bfd 100644 --- a/Assets/Scripts/UI/Prefab/NewsController.cs +++ b/Assets/Scripts/UI/Prefab/NewsController.cs @@ -17,10 +17,19 @@ public class NewsController : PFUIPanel UIManager.AddEvent(exit.gameObject, EventTriggerType.PointerClick, (b) => { Close(); + if (App.multiNotifyContent.Count > 0) + { + transform.Find("Main").Find("Inner").Find("Content").GetComponent().text = App.multiNotifyContent.Dequeue(); + Invoke("Open", 0.3f); + } }); } Get(); } + void Open() + { + gameObject.SetActive(true); + } Transform content,exit; void Get() { diff --git a/Assets/Scripts/UI/Prefab/Panel/MapListController.cs b/Assets/Scripts/UI/Prefab/Panel/MapListController.cs index b895e671..4337a15e 100644 --- a/Assets/Scripts/UI/Prefab/Panel/MapListController.cs +++ b/Assets/Scripts/UI/Prefab/Panel/MapListController.cs @@ -326,7 +326,7 @@ public class MapListController : PFUIPanel mc.GetComponent().alpha = 0; mc.GetComponent().DOFade(1, 0.3f); #else - var topRect = topContainer; + var topRect = transform.Find("Panel/Top/Container"); #endif if (isFocusSearch) { diff --git a/ProjectSettings/EditorBuildSettings.asset b/ProjectSettings/EditorBuildSettings.asset index 999e430b..c5b8a1b5 100644 --- a/ProjectSettings/EditorBuildSettings.asset +++ b/ProjectSettings/EditorBuildSettings.asset @@ -6,8 +6,8 @@ EditorBuildSettings: serializedVersion: 2 m_Scenes: - enabled: 1 - path: Assets/Scenes/Login-Mobile.unity - guid: 4be878da00cf764499988cf403faf94d + path: Assets/Scenes/Login.unity + guid: 6dce3e17997730b4492f91dd8fede429 - enabled: 1 path: Assets/Scenes/MainScene.unity guid: ab586a3c1bacd4a48a55178eb06fe0cc