From 38b3180a588c4615216a7d5de8f23714a24ec7c8 Mon Sep 17 00:00:00 2001 From: shenjianxing <”315615051@qq.com“> Date: Thu, 22 May 2025 20:21:55 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E8=82=8C=E8=82=89bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Assets/Scripts/UI/UIBody3D.cs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/Assets/Scripts/UI/UIBody3D.cs b/Assets/Scripts/UI/UIBody3D.cs index 544bb8d3..d7703b82 100644 --- a/Assets/Scripts/UI/UIBody3D.cs +++ b/Assets/Scripts/UI/UIBody3D.cs @@ -48,13 +48,17 @@ namespace QFramework.Example item.gameObject.SetActive(true); } index++; + if (index >= bodys.Count) + { + index = bodys.Count - 1; + } } } } public void Sub() { - if (index > 0) + if (index >= 0) { string name = bodys[index]; var body = root.subBody[name]; @@ -66,6 +70,10 @@ namespace QFramework.Example item.gameObject.SetActive(false); } index--; + if (index < 0) + { + index = 0; + } } } }