From 86ec353733265fa82fff8524351762d45df0ef44 Mon Sep 17 00:00:00 2001 From: "ALIENJACK\\alien" Date: Thu, 12 Sep 2024 11:02:30 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8DUI=E8=A1=A8=E7=8E=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- AxibugEmuOnline.Client/Assets/Script/UI/Game_NES.cs | 6 ++++-- AxibugEmuOnline.Client/Assets/Script/UI/MenuItem.cs | 6 +++++- .../Assets/Script/UI/ThirdMenuRoot.cs | 11 ++++++++++- 3 files changed, 19 insertions(+), 4 deletions(-) diff --git a/AxibugEmuOnline.Client/Assets/Script/UI/Game_NES.cs b/AxibugEmuOnline.Client/Assets/Script/UI/Game_NES.cs index a22f046..a772f8b 100644 --- a/AxibugEmuOnline.Client/Assets/Script/UI/Game_NES.cs +++ b/AxibugEmuOnline.Client/Assets/Script/UI/Game_NES.cs @@ -13,8 +13,10 @@ namespace AxibugEmuOnline.Client CanvasGroup RomGroupRoot; private TweenerCore m_showTween; - private void Awake() + protected override void Awake() { + base.Awake(); + RomGroupRoot.gameObject.SetActive(false); RomGroupRoot.alpha = 0; } @@ -58,7 +60,7 @@ namespace AxibugEmuOnline.Client thirdMenuGroup.itemGroup.UpdateDependencyProperty(thirdMenuGroup); thirdMenuGroup.itemGroup.SetData(roms); thirdMenuGroup.itemGroup.UpdateProxyVisualState(); - thirdMenuGroup.SelectIndex = 0; + thirdMenuGroup.ResetToFirst(); }); if (SubMenuItemGroup != null) SubMenuItemGroup.SetSelect(true); diff --git a/AxibugEmuOnline.Client/Assets/Script/UI/MenuItem.cs b/AxibugEmuOnline.Client/Assets/Script/UI/MenuItem.cs index e4ed2f2..2adfc87 100644 --- a/AxibugEmuOnline.Client/Assets/Script/UI/MenuItem.cs +++ b/AxibugEmuOnline.Client/Assets/Script/UI/MenuItem.cs @@ -33,6 +33,11 @@ namespace AxibugEmuOnline.Client.UI protected TweenerCore progressTween; protected float m_progress; + protected virtual void Awake() + { + Reset(); + } + public void SetData(MenuData data) { Reset(); @@ -47,7 +52,6 @@ namespace AxibugEmuOnline.Client.UI m_select = false; m_progress = 0f; - if (InfoNode != null) InfoNode.alpha = 0; Root.localScale = Vector3.one * UnSelectScale; if (progressTween != null) { progressTween.Kill(); progressTween = null; } diff --git a/AxibugEmuOnline.Client/Assets/Script/UI/ThirdMenuRoot.cs b/AxibugEmuOnline.Client/Assets/Script/UI/ThirdMenuRoot.cs index d7217ad..74b6a40 100644 --- a/AxibugEmuOnline.Client/Assets/Script/UI/ThirdMenuRoot.cs +++ b/AxibugEmuOnline.Client/Assets/Script/UI/ThirdMenuRoot.cs @@ -39,6 +39,12 @@ namespace AxibugEmuOnline.Client } } + public void ResetToFirst() + { + m_selectIndex = -1; + SelectIndex = 0; + } + protected override MenuItem GetItemUIByIndex(int index) { return itemGroup.GetItemUIByDataIndex(index).GetComponent(); @@ -89,7 +95,10 @@ namespace AxibugEmuOnline.Client if (!useAnim) srollRect.content.anchoredPosition += new Vector2(0, gap); else - srollRect.content.anchoredPosition += new Vector2(0, gap); + { + var endValue = srollRect.content.anchoredPosition + new Vector2(0, gap); + DOTween.To(() => srollRect.content.anchoredPosition, (x) => srollRect.content.anchoredPosition = x, endValue, 0.125f); + } } Vector3[] corner = new Vector3[4];