From 34feae945c2047728e53f9fc87a4610b05230534 Mon Sep 17 00:00:00 2001 From: shenjianxing <”315615051@qq.com“> Date: Mon, 7 Apr 2025 09:40:06 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8DUI=E4=B8=8D=E6=B6=88=E5=A4=B1?= =?UTF-8?q?=E7=9A=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Assets/Scripts/UI/UITimeTip.cs | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/Assets/Scripts/UI/UITimeTip.cs b/Assets/Scripts/UI/UITimeTip.cs index 5cb20689..44bcdcc2 100644 --- a/Assets/Scripts/UI/UITimeTip.cs +++ b/Assets/Scripts/UI/UITimeTip.cs @@ -85,8 +85,15 @@ namespace QFramework.Example imgTwen = DOTween.To(() => index, v => { index = v; - Img.sprite = sprites[index]; - Img.SetNativeSize(); + if (index >= 0 && index < sprites.Count) + { + Img.sprite = sprites[index]; + Img.SetNativeSize(); + } + else + { + Debug.LogError("ͼƬԽ"); + } }, endIndex, mData.time);