FairyGUI 列表第一个元素在game mode下的stage camera中不可见

大家好,
我在使用fairyGUI时遇到了一个奇怪的问题,希望大家帮忙看一下
 
我在用列表组件时,列表的第一个元素在game mode下的stage camera下不可见。
类似这样:

屏幕截图_2021-03-13_145203.png

 
如果我滚动列表至第二列,那么突然间第二行第一个也变得不可见了

屏幕截图_2021-03-13_145219.png

大概就是在这个列表中,处于显示位置的第一个元素总是会不可见。
 
在game mode下,scene窗口中,我如果用stage camera的位置去看UI,那么它依旧不可见,
但是如果我通过鼠标滚轮拉近镜头距离,这个元素就又能显示出来了:

屏幕截图_2021-03-13_145235.png

我尝试调整stage camera的位置和显示距离,都不能在game窗口中看到这个元素。
我的UI中有很多列表,只有这一个列表遇到了这个问题。这个问题好像时在我一次在fairygui中更新了列表元素后出现的问题,但是我别的列表用同样的元素就没有这样的问题。
 
希望大家可以帮忙看看是为什么
 
编辑:
我这个列表是一个virtual list,这个virtual list的实现同时用在了几个不同的列表中,但是只有这一个列表出现了问题。
这是这个虚拟列表的base class
    public abstract class VirtualItemList<T> where T : InventoryItem
{
public List<T> items;
protected GList list;

public void Setup(List<T> items, GList list)
{
this.items = items;
this.list = list;

list.defaultItem = UIPackage.GetItemURL(GlobalElementsPackageName, ItemSlotComponentName);
list.itemRenderer = RenderListItem;
var callback = GetOnClickItemCallBack();
if (callback != null)
{
list.onClickItem.Add(GetOnClickItemCallBack());
}

list.SetVirtual();
list.numItems = items.Count;
}

public abstract EventCallback1 GetOnClickItemCallBack();

public virtual void RenderListItem(int index, GObject obj)
{
var item = items[index];
var itemSlot = obj.asCom;
ItemSlotHelper.SetupSlot(item, itemSlot);

itemSlot.touchable = true;
}

public void RefreshList()
{
list.numItems = items.Count;
list.RefreshVirtualList();
}
}
这是这个列表的具体class
    public class EquipmentEnchantmentComponentEquipmentList : VirtualItemList<Equipment>
{
public override EventCallback1 GetOnClickItemCallBack()
{
return OnClickItem;
}

private void OnClickItem(EventContext context)
{
var itemSlot = (GComponent) context.data;
var index = list.ChildIndexToItemIndex(list.GetChildIndex(itemSlot));

var item = items[index];
MainSceneMainPanelController.Instance.OnSelectEquipmentInEnchantmentPage(item);
}
}


谢谢!
已邀请:

谷主

赞同来自:

你具体做了什么也没说,只有结果图。看不出问题。

要回复问题请先登录注册