private void OnSelectPreTab() { string tab = _curTab; int len = _showItems.Count; int index = _showItems.IndexOf(tab); index--; if (index < 0) { index = 0; } if (index >= len) { index = len - 1; } tab = _showItems[index]; TabSelectAnimBtnItem item = GetTabBtn(tab); if (item == null || item.data == null) { return; } if (item.data.lockState) { return; } SelectTabBtn(tab); }
public void SelectTabBtn(string tab) { TabSelectAnimBtnItem item = GetTabBtn(tab); if (item != null) { item.isOn = true; } OnTabBtnValueChange(tab, true); }
public void SetData(List <TabSelectAnimBtnData> datas) { _items.Clear(); for (int i = 0; i < datas.Count; ++i) { TabSelectAnimBtnItem item = _grid.Find(datas[i].path).GetComponent <TabSelectAnimBtnItem>(); item.Init(datas[i], OnTabBtnValueChange); item.onSelectNextTab = OnSelectNextTab; item.onSelectPreTab = OnSelectPreTab; _items.Add(datas[i].path, item); } CheckShowItems(); }