From 2f6e9cdaf334e6078be4eeafb74dea0f90cc8486 Mon Sep 17 00:00:00 2001 From: lrc <571244399@qq.com> Date: Fri, 13 Nov 2026 15:20:06 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BF=BB=E9=A1=B5/=E6=BB=9A=E5=8A=A8=E5=88=97?= =?UTF-8?q?=E8=A1=A8=EF=BC=9A=E6=B2=A1=E6=9C=89=E9=A1=B5=E3=80=81=E6=B2=A1?= =?UTF-8?q?=E6=9C=89=E6=B1=A0=E9=85=8D=E7=BD=AE=E6=97=B6=E4=B8=8D=E5=86=8D?= =?UTF-8?q?=E6=8A=9B=E7=A9=BA=E5=BC=95=E7=94=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 翻页:总页数为 0 时 FlipsPage 会去访问第 0 页的节点(没有),先判 TotalPageCount > 0。 - 滚动列表:childrenPool 是后来加的字段,老预制体里为空;无条件 Initialize 会在 Start 抛 ArgumentNullException,没配预制体就跳过(不池化照常滚动)。 --- Runtime/FlipPage/XericFlipPageIndexVesselBase.cs | 5 ++++- Runtime/OverrideLayout/XericScrollRect.cs | 6 +++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/Runtime/FlipPage/XericFlipPageIndexVesselBase.cs b/Runtime/FlipPage/XericFlipPageIndexVesselBase.cs index 2a1fa4e..5a3b3e5 100644 --- a/Runtime/FlipPage/XericFlipPageIndexVesselBase.cs +++ b/Runtime/FlipPage/XericFlipPageIndexVesselBase.cs @@ -169,7 +169,10 @@ namespace XericUI.FlipPage { base.Start(); - FlipPage(currentPageIndex); + // һҳ¶¼»¹ûÓÐʱ²»Ҫ·­£¨ҳͨ³£ÊÇÔËÐÐÆڲżӽøÀ´µģ©£ºԭÀ´»á×ßһ±é + // ¡°Ë÷Òý0ϵĽڵ㲻´æÔÚ(×ÜÊý0ҳ)¡± ²¢±¨һÌõ Error£¬Æô¶¯ÈÕ־Àﲻ¸ÃÓÐËü¡£ + if (TotalPageCount > 0) + FlipPage(currentPageIndex); } protected override void OnDestroy() diff --git a/Runtime/OverrideLayout/XericScrollRect.cs b/Runtime/OverrideLayout/XericScrollRect.cs index 8492b51..277cc04 100644 --- a/Runtime/OverrideLayout/XericScrollRect.cs +++ b/Runtime/OverrideLayout/XericScrollRect.cs @@ -248,7 +248,11 @@ namespace XericUI.OverrideLayout protected override void Start() { base.Start(); - childrenPool.Initialize(); + // childrenPool 是这个插件后来加的格:老预制体里根本没有这一项(加载后是空池), + // 无条件 Initialize 会在 Start 里抛 ArgumentNullException。没配预制体就跳过—— + // 不用对象池的滚动列表照常滚动,只是没有池化子项。 + if (childrenPool != null && childrenPool.Prefab != null) + childrenPool.Initialize(); } protected override void SetContentAnchoredPosition(Vector2 position)