Esempio n. 1
0
    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);
    }
Esempio n. 2
0
    public void SelectTabBtn(string tab)
    {
        TabSelectAnimBtnItem item = GetTabBtn(tab);

        if (item != null)
        {
            item.isOn = true;
        }
        OnTabBtnValueChange(tab, true);
    }
Esempio n. 3
0
 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();
 }