翻页/滚动列表:没有页、没有池配置时不再抛空引用

- 翻页:总页数为 0 时 FlipsPage 会去访问第 0 页的节点(没有),先判 TotalPageCount > 0。
- 滚动列表:childrenPool 是后来加的字段,老预制体里为空;无条件 Initialize 会在 Start 抛
  ArgumentNullException,没配预制体就跳过(不池化照常滚动)。
This commit is contained in:
2026-11-13 15:20:06 +08:00
parent 8cad09f350
commit 2f6e9cdaf3
2 changed files with 9 additions and 2 deletions
+5 -1
View File
@@ -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)