else if(reply.upcomingEventsItem.Count > 0)
{
Debug.Log("reply.buyPackage == null 或 this.eventsReply == null");
UpComingBuffer.GetInstance().UpComingEventList = reply.upcomingEventsItem;
this.eventsReply = reply;
//ResourcesLoader.Load("UI/prefab/UIdailyItem", onLoaded:(obj) =>
ResourcesLoader.Load("UI/prefab/UIActivityHubItemCell", (obj) =>
{
this.updateEventCell(this.eventsReply);
});
Debug.Log("初始reply.upcomingEventsItem.Count = "+reply.upcomingEventsItem.Count +
" 已加载完左侧条目cell列表,cellList.Count = " + cellList.Count);
//触发一下第一次打开时选中第一个itemCell
if (!isFirstCellSelected && CellListWonderful.Count > 0)
{
CellListWonderful.LastOrDefault().GetComponent().onClick.Invoke();
isFirstCellSelected = true;
}
}
else
{
Debug.Log("reply.upcomingEventsItem和reply.upcomingEventsBuy都为空");
}
}
else
{
Debug.Log("反信失败" );
}
实际运行时机是 1,2,3, 但目的是 1, 3, 2
把 上面的步骤2 移动回调就可以了:
else if(reply.upcomingEventsItem.Count > 0)
{
Debug.Log("reply.buyPackage == null 或 this.eventsReply == null");
UpComingBuffer.GetInstance().UpComingEventList = reply.upcomingEventsItem;
this.eventsReply = reply;
//ResourcesLoader.Load("UI/prefab/UIdailyItem", (obj) =>
ResourcesLoader.Load("UI/prefab/UIActivityHubItemCell", (obj) =>
{
this.updateEventCell(this.eventsReply);
//触发一下第一次打开时选中第一个itemCell
if (!isFirstCellSelected && CellListWonderful.Count > 0)
{
CellListWonderful.LastOrDefault().GetComponent().onClick.Invoke();
isFirstCellSelected = true;
}
});
Debug.Log("初始reply.upcomingEventsItem.Count = "+reply.upcomingEventsItem.Count +
" 已加载完左侧条目cell列表,cellList.Count = " + cellList.Count);
}
else
{
Debug.Log("reply.upcomingEventsItem和reply.upcomingEventsBuy都为空");
}