From e9dd949c10630d6e0267b33eef0f5d52ed567aff Mon Sep 17 00:00:00 2001 From: "ALIENJACK\\alien" Date: Wed, 13 Nov 2024 14:03:11 +0800 Subject: [PATCH] =?UTF-8?q?=E7=A7=BB=E9=99=A4=E6=93=8D=E4=BD=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Script/UI/CommandDispatcher/CommandDispatcher.cs | 1 - .../Assets/Script/UI/OptionUI/OptionUI.cs | 8 +++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/AxibugEmuOnline.Client/Assets/Script/UI/CommandDispatcher/CommandDispatcher.cs b/AxibugEmuOnline.Client/Assets/Script/UI/CommandDispatcher/CommandDispatcher.cs index 3beece3..1a874a7 100644 --- a/AxibugEmuOnline.Client/Assets/Script/UI/CommandDispatcher/CommandDispatcher.cs +++ b/AxibugEmuOnline.Client/Assets/Script/UI/CommandDispatcher/CommandDispatcher.cs @@ -1,4 +1,3 @@ -using System; using System.Collections.Generic; using UnityEngine; diff --git a/AxibugEmuOnline.Client/Assets/Script/UI/OptionUI/OptionUI.cs b/AxibugEmuOnline.Client/Assets/Script/UI/OptionUI/OptionUI.cs index 99f9dad..7f59fb4 100644 --- a/AxibugEmuOnline.Client/Assets/Script/UI/OptionUI/OptionUI.cs +++ b/AxibugEmuOnline.Client/Assets/Script/UI/OptionUI/OptionUI.cs @@ -1,6 +1,7 @@ using DG.Tweening; using System; using System.Collections.Generic; +using System.Linq; using UnityEngine; namespace AxibugEmuOnline.Client @@ -32,12 +33,13 @@ namespace AxibugEmuOnline.Client get { return m_selectIndex; } set { - value = Mathf.Clamp(value, 0, m_runtimeMenuItems.Count - 1); + var selectableItems = m_runtimeMenuItems.Where(t => t.Visible).ToList(); + value = Mathf.Clamp(value, 0, selectableItems.Count - 1); if (m_selectIndex == value) return; - + m_selectIndex = value; - OptionUI_MenuItem optionUI_MenuItem = m_runtimeMenuItems[m_selectIndex]; + OptionUI_MenuItem optionUI_MenuItem = selectableItems[m_selectIndex]; optionUI_MenuItem.OnFocus(); var itemUIRect = optionUI_MenuItem.transform as RectTransform; SelectBorder.pivot = itemUIRect.pivot;