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];