新增菜单all和列表标题功能
This commit is contained in:
@@ -4,6 +4,7 @@ using System.Collections.Generic;
|
||||
using FairyGUI;
|
||||
using NBC;
|
||||
using NUnit.Framework;
|
||||
using UnityEngine;
|
||||
using UIPanel = NBC.UIPanel;
|
||||
|
||||
namespace NBF
|
||||
@@ -11,8 +12,6 @@ namespace NBF
|
||||
public class ShopGearData
|
||||
{
|
||||
public string title;
|
||||
public int type;
|
||||
public int subType;
|
||||
}
|
||||
|
||||
public partial class FishingShopPanel : UIPanel
|
||||
@@ -23,21 +22,32 @@ namespace NBF
|
||||
this.AutoAddClick(OnClick);
|
||||
IsShowCursor = true;
|
||||
|
||||
var testData = new List<ShopGearData>();
|
||||
List<TabItemData> tabItemList = new List<TabItemData>();
|
||||
for (int i = 0; i < 10; i++)
|
||||
{
|
||||
for (int j = 20; j < 25; j++)
|
||||
TabItemData tabItem = new TabItemData();
|
||||
tabItem.Key = $"Tab_{i}";
|
||||
for (int j = 0; j < 5; j++)
|
||||
{
|
||||
var item = new ShopGearData
|
||||
TabItemData tabSubItem = new TabItemData();
|
||||
tabSubItem.Key = $"SubTab_{j}";
|
||||
var count = Random.Range(2, 5);
|
||||
for (int k = 0; k < count; k++)
|
||||
{
|
||||
type = i,
|
||||
subType = j
|
||||
};
|
||||
testData.Add(item);
|
||||
var item = new ShopGearData
|
||||
{
|
||||
title = $"Item:{i}-{j}-{k}"
|
||||
};
|
||||
tabSubItem.Items.Add(item);
|
||||
}
|
||||
|
||||
tabItem.Children.Add(tabSubItem);
|
||||
}
|
||||
|
||||
tabItemList.Add(tabItem);
|
||||
}
|
||||
|
||||
ItemList.SetData(testData);
|
||||
ItemList.SetData(tabItemList, true, true);
|
||||
}
|
||||
|
||||
protected override void OnShow()
|
||||
|
||||
Reference in New Issue
Block a user