From 24044ec7726c8a268ade67b2c17763104c99fd0d Mon Sep 17 00:00:00 2001 From: CaiYanPeng Date: Thu, 16 Dec 2021 16:00:14 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B7=B3=E4=B8=8A=E4=BC=A0=E7=BA=BF=E8=B7=AF?= =?UTF-8?q?=E7=BD=91=E9=A1=B5=EF=BC=9Bpc=E5=88=86=E4=B8=A4=E7=A7=8D?= =?UTF-8?q?=E6=B6=88=E6=81=AF=E5=BC=B9=E7=AA=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Images/newroute/System_map_mode.png | Bin 0 -> 2810 bytes .../Images/newroute/System_map_mode.png.meta | 128 ++++ .../UI/Prefab/MapList/MapItem.prefab | 4 +- .../UI/Prefab/Panel/MapListPanel.prefab | 2 +- .../Prefab/Panel/Mobile/MapListPanel.prefab | 331 +++-------- .../Panel/Mobile/NewRouteDetailPanel.prefab | 382 ++++++------ .../Panel/Mobile/NewRouteOverviewPanel.prefab | 348 ++++++++++- .../Prefab/Panel/NewRouteDetailPanel.prefab | 108 +++- .../Prefab/Panel/NewRouteOverviewPanel.prefab | 267 ++++++++- Assets/Scenes/MainScene.unity | 548 +++++++++++++++--- Assets/Scripts/App.cs | 15 +- Assets/Scripts/Scenes/MainController.cs | 90 ++- .../UI/Prefab/Panel/BigMapController.cs | 2 +- .../UI/Prefab/Panel/EarthController.cs | 4 +- .../UI/Prefab/Panel/MapListController.cs | 22 +- .../Prefab/Panel/NewRouteDetailController.cs | 4 + .../Panel/NewRouteOverviewController.cs | 10 + Assets/Scripts/UIManager.cs | 2 + ProjectSettings/GraphicsSettings.asset | 1 - 19 files changed, 1642 insertions(+), 626 deletions(-) create mode 100644 Assets/Resources/Images/newroute/System_map_mode.png create mode 100644 Assets/Resources/Images/newroute/System_map_mode.png.meta diff --git a/Assets/Resources/Images/newroute/System_map_mode.png b/Assets/Resources/Images/newroute/System_map_mode.png new file mode 100644 index 0000000000000000000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ODbe6}__Js5#q?v#QY66mTy6Cm(a6PgIx!w$TH3Jo&Fz2KwrlgYWgR*2h!F6>CEn}@%G z0ZBJ^*fMf0`U%HKN#bejD{R#l_B(oUhX|)c$snCwr3O8Y+oI>?~yABBsuh)=CQ?@a z2lj5{6B$0_0KaL_nznJv9^A`3o_ox RouteNameDict = new Dictionary(); - + public static bool _currentPageIsHome = false; + public static event EventHandler isHomeChanged; + public static bool currentPageIsHome + { + get => _currentPageIsHome; + set + { + _currentPageIsHome = value; + if (isHomeChanged != null) + { + isHomeChanged(value, new EventArgs()); + } + } + } static App() { InitLanguage(); diff --git a/Assets/Scripts/Scenes/MainController.cs b/Assets/Scripts/Scenes/MainController.cs index be54b6b5..ffec6bc5 100644 --- a/Assets/Scripts/Scenes/MainController.cs +++ b/Assets/Scripts/Scenes/MainController.cs @@ -52,11 +52,28 @@ public class MainController : BaseScene App.MainDeviceAdapter.StartScan(); #endif EventQueueSystem.AddListener(LinkedMessageHandler); + App.isHomeChanged -= OnIsHomeChanged; + App.isHomeChanged += OnIsHomeChanged; } - + #region 显示消息有关 + //切换页面后 + private void OnIsHomeChanged(object sender, EventArgs e) + { + DOTween.KillAll(); + if ((bool)sender) + { + FinishMessageRight(); + } + else + { + FinishMessageLeft(); + } + } + CanvasGroup[] msgs; Vector3 msgLocation; int msgIndex = 0; + CanvasGroup rightMessage; private void InitialMessage() { msgLocation = 1 * msg.transform.localPosition; @@ -71,20 +88,51 @@ public class MainController : BaseScene msg3.transform.localScale = Vector3.one; msg3.alpha = 0; msgs = new CanvasGroup[] { msg, msg2, msg3 }; + + rightMessage = transform.Find("GameObject/MessageRight").GetComponent(); +#if !UNITY_STANDALONE_WIN + +#endif } private void LinkedMessageHandler(LinkedMessageEvent e) { //msg.transform.Find("Content") emptyt = 0; +#if UNITY_STANDALONE_WIN Debug.Log(e.content); - DoMessage(e); + if (App.currentPageIsHome) + { + DoMessage(e); + } + else + { + DoMessageRight(e); + } +#else + +#endif + } + private void DoMessageRight(LinkedMessageEvent e) + { + SetMessage(rightMessage, e); + rightMessage.DOFade(1, 0.5f).onComplete = () => + { + if (App.currentPageIsHome) + { + foreach (var item in msgs) + { + item.alpha = 0; + } + } + Invoke("fade0", 0.8f); + }; } - private void DoMessage(LinkedMessageEvent e) { + var selectIndex = msgIndex % 3; - var m = msgs[selectIndex]; + var m = msgs[selectIndex]; if (msgIndex >= 3) // { //msgIndex = 0; @@ -107,8 +155,18 @@ public class MainController : BaseScene } msgIndex++; } - void FinishMessage() + { + if (App.currentPageIsHome) + { + FinishMessageLeft(); + } + else + { + FinishMessageRight(); + } + } + void FinishMessageLeft() { msgIndex = 0; foreach (var item in msgs) @@ -116,6 +174,12 @@ public class MainController : BaseScene item.DOFade(0, 0.3f); } } + + void FinishMessageRight() + { + msgIndex = 0; + rightMessage.DOFade(0, 0.3f); + } private void SetMessage(CanvasGroup m,LinkedMessageEvent e) { m.transform.Find("Avatar").GetComponent().texture = null; @@ -123,6 +187,12 @@ public class MainController : BaseScene m.transform.Find("Nickname").GetComponent().text = e.nickname; m.transform.Find("Content").GetComponent().text = e.content; } + CanvasGroup msg; + void fade0() + { + rightMessage.DOFade(0, 0.5f); + } +#endregion // Start is called before the first frame update async void Start() { @@ -301,11 +371,7 @@ public class MainController : BaseScene } } - CanvasGroup msg; - void fade0() - { - msg.DOFade(0, 0.5f); - } + private async Task Login() { var result = await ConfigHelper.userApi.Login("13115011550", "laozhong", ""); @@ -331,4 +397,8 @@ public class MainController : BaseScene } } } + private void OnDestroy() + { + App.isHomeChanged -= OnIsHomeChanged; + } } diff --git a/Assets/Scripts/UI/Prefab/Panel/BigMapController.cs b/Assets/Scripts/UI/Prefab/Panel/BigMapController.cs index 72001ec9..62e471f0 100644 --- a/Assets/Scripts/UI/Prefab/Panel/BigMapController.cs +++ b/Assets/Scripts/UI/Prefab/Panel/BigMapController.cs @@ -103,7 +103,7 @@ public class BigMapController : PFUIPanel { mapManager.Destroy(); UIManager.PopStack(); - UIManager.ShowMapListPanel(); + UIManager.ShowNewRouteOverviewPanel(); //this.gameObject.SetActive(false); //DestroyImmediate(this.gameObject); }); diff --git a/Assets/Scripts/UI/Prefab/Panel/EarthController.cs b/Assets/Scripts/UI/Prefab/Panel/EarthController.cs index 65c29732..fa063c10 100644 --- a/Assets/Scripts/UI/Prefab/Panel/EarthController.cs +++ b/Assets/Scripts/UI/Prefab/Panel/EarthController.cs @@ -83,9 +83,9 @@ public class EarthController : PFUIPanel SetRounded(goList, 64); #endif UIManager.AddEvent(goList.Find("GoList").gameObject, EventTriggerType.PointerClick, (e) => - { + { //UIManager.PopStack(); - UIManager.ShowMapListPanel(); + UIManager.ShowNewRouteOverviewPanel(); //this.gameObject.SetActive(false); //DestroyImmediate(this.gameObject); }); diff --git a/Assets/Scripts/UI/Prefab/Panel/MapListController.cs b/Assets/Scripts/UI/Prefab/Panel/MapListController.cs index 1bcdaf3b..7834f9d2 100644 --- a/Assets/Scripts/UI/Prefab/Panel/MapListController.cs +++ b/Assets/Scripts/UI/Prefab/Panel/MapListController.cs @@ -98,6 +98,15 @@ public class MapListController : PFUIPanel map = Resources.Load("UI/Prefab/MapList/MapItem-Mobile"); #else topContainer = transform.Find("Panel").Find("Top"); +#endif +#if UNITY_STANDALONE_WIN + btnMapMode = this.transform.Find("SwitchMode").gameObject; + SetRounded(btnMapMode.transform, 64); + UIManager.AddEvent(btnMapMode.transform.Find("GoList").gameObject, EventTriggerType.PointerClick, (e) => + { + Application.OpenURL("http://192.168.0.101:3081/Mine/Upload?token="+ App.CurrentUser.cookie); + }); + #endif transform.Find("MainNav").GetComponent().ShowBack(); sort = "Near"; @@ -107,15 +116,7 @@ public class MapListController : PFUIPanel // hardSelector.onValueChanged.AddListener(ChangeHard); //} //ApiBase.SetCookie("15A37DF28842CBA8E4E550BFA24186C8222D392F3EE18D9E95A49CC32796D2E3F6E40385C6A114942546EE1DD793DF34880DE48090B91AD2460EB887B59664BB3965F3371DDA1F1401EC7F27C5A1084566E47069F12CB6BBC0BC7A84ADC5582B"); - btnMapMode = this.transform.Find("SwitchMode").gameObject; - SetRounded(btnMapMode.transform, 64); - UIManager.AddEvent(btnMapMode.transform.Find("GoList").gameObject, EventTriggerType.PointerClick, (e) => - { - UIManager.PopStack(); - //UIManager.ShowBigMapPanel(); - UIManager.ShowEarthPanel(App.latitude, App.longitude); - }); if (content!=null) { //var transform = content.transform.GetComponent(); @@ -459,7 +460,10 @@ public class MapListController : PFUIPanel { isRecent = true; } - transform.Find("Panel/Top/FavContainer").gameObject.SetActive(App.CurrentRouteType != "My Collection"); +#if UNITY_STANDALONE_WIN + btnMapMode.SetActive(App.CurrentRouteType == "My Upload"); +#endif + topContainer.Find("FavContainer").gameObject.SetActive(App.CurrentRouteType != "My Collection"); } void ResetList() { diff --git a/Assets/Scripts/UI/Prefab/Panel/NewRouteDetailController.cs b/Assets/Scripts/UI/Prefab/Panel/NewRouteDetailController.cs index 6260fd7d..c7c9af25 100644 --- a/Assets/Scripts/UI/Prefab/Panel/NewRouteDetailController.cs +++ b/Assets/Scripts/UI/Prefab/Panel/NewRouteDetailController.cs @@ -92,6 +92,8 @@ public class NewRouteDetailController : PFUIPanel .text = string.Empty; transform.Find("Container/Left/Infos/SlopeContainer/Text").GetComponent() .text = string.Empty; + transform.Find("Container/Left/Desc").GetComponent() + .text = string.Empty; if (area.BannerImage != null) { Utils.DisplayImageTempDict(left.Find("Icon").GetComponent(), area.BannerImage, caches); @@ -124,6 +126,8 @@ public class NewRouteDetailController : PFUIPanel .text = $"{res.data.TotalClimb.ToString("#0")}M"; transform.Find("Container/Left/Infos/SlopeContainer/Text").GetComponent() .text = $"{res.data.AverageGrade.ToString("#0.00")}%"; + transform.Find("Container/Left/Desc").GetComponent() + .text = res.data.Description; LayoutRebuilder.ForceRebuildLayoutImmediate(transform.Find("Container/Left/RideContainer").GetComponent()); } } diff --git a/Assets/Scripts/UI/Prefab/Panel/NewRouteOverviewController.cs b/Assets/Scripts/UI/Prefab/Panel/NewRouteOverviewController.cs index 8c94afc4..3efe20ad 100644 --- a/Assets/Scripts/UI/Prefab/Panel/NewRouteOverviewController.cs +++ b/Assets/Scripts/UI/Prefab/Panel/NewRouteOverviewController.cs @@ -56,6 +56,16 @@ public class NewRouteOverviewController: PFUIPanel tmpGroup = Resources.Load("UI/Prefab/NewRoute/Mobile/RouteGroup"); tmpItem = Resources.Load("UI/Prefab/NewRoute/Mobile/RouteItem"); #endif + + var btnMapMode = this.transform.Find("SwitchMode").gameObject; + SetRounded(btnMapMode.transform, 64); + UIManager.AddEvent(btnMapMode.transform.Find("GoList").gameObject, EventTriggerType.PointerClick, (e) => + { + UIManager.PopStack(); + //UIManager.ShowBigMapPanel(); + UIManager.ShowEarthPanel(App.latitude, App.longitude); + }); + collectionContent = transform.Find("Container/Right/Scroll View/Viewport/Content") .GetComponent(); Refresh(); diff --git a/Assets/Scripts/UIManager.cs b/Assets/Scripts/UIManager.cs index 5b49b15e..8051549a 100644 --- a/Assets/Scripts/UIManager.cs +++ b/Assets/Scripts/UIManager.cs @@ -590,6 +590,8 @@ public class UIManager : MonoBehaviour return; } + App.currentPageIsHome = panelToShow.Equals(UIManager.Instance.HomePanel); + if (modal) { parent = UIManager.Instance.ModalsPanel; diff --git a/ProjectSettings/GraphicsSettings.asset b/ProjectSettings/GraphicsSettings.asset index 9b996cb4..4706883c 100644 --- a/ProjectSettings/GraphicsSettings.asset +++ b/ProjectSettings/GraphicsSettings.asset @@ -38,7 +38,6 @@ GraphicsSettings: - {fileID: 16000, guid: 0000000000000000f000000000000000, type: 0} - {fileID: 16001, guid: 0000000000000000f000000000000000, type: 0} - {fileID: 17000, guid: 0000000000000000f000000000000000, type: 0} - - {fileID: 16003, guid: 0000000000000000f000000000000000, type: 0} m_PreloadedShaders: [] m_SpritesDefaultMaterial: {fileID: 10754, guid: 0000000000000000f000000000000000, type: 0}